“Bad Gateway” when connecting to old IIS servers over SSL through NGINX reverse proxy The 2019 Stack Overflow Developer Survey Results Are InNginx has ssl module, but thinks it doesn'tNginx proxy pass works for https but not httpnginx ssl proxy for one hostname onlyNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsNginX + WordPress + SSL + non-www + W3TC vhost config file questionsNginx Reverse Proxy 502 Bad Gatewaynginx reverse proxy hide login query also on 301 redirect or full qualified urlConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsnginx (reverse proxy + ssl): shifting conf-lines destroys configurationNginx reverse proxy to many local servers + webserver duty

Origin of "cooter" meaning "vagina"

Can a flute soloist sit?

Button changing it's text & action. Good or terrible?

Is three citations per paragraph excessive for undergraduate research paper?

Does the shape of a die affect the probability of a number being rolled?

What do the Banks children have against barley water?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Geography at the pixel level

What is the meaning of Triage in Cybersec world?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Pokemon Turn Based battle (Python)

Aging parents with no investments

Are spiders unable to hurt humans, especially very small spiders?

Output the Arecibo Message

Am I thawing this London Broil safely?

The difference between dialogue marks

"as much details as you can remember"

Falsification in Math vs Science

Loose spokes after only a few rides

Why didn't the Event Horizon Telescope team mention Sagittarius A*?

Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?

How to save as into a customized destination on macOS?

How to notate time signature switching consistently every measure

Deal with toxic manager when you can't quit



“Bad Gateway” when connecting to old IIS servers over SSL through NGINX reverse proxy



The 2019 Stack Overflow Developer Survey Results Are InNginx has ssl module, but thinks it doesn'tNginx proxy pass works for https but not httpnginx ssl proxy for one hostname onlyNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsNginX + WordPress + SSL + non-www + W3TC vhost config file questionsNginx Reverse Proxy 502 Bad Gatewaynginx reverse proxy hide login query also on 301 redirect or full qualified urlConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsnginx (reverse proxy + ssl): shifting conf-lines destroys configurationNginx reverse proxy to many local servers + webserver duty



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to set up an NGINX server as a reverse proxy to make it possible to connect via TLS 1.2 to an old IIS server that is limited to TLS 1.0



Connection on port 80 works fine. But I get 502 Bad Gateway when I try to connect over https. When I look at the NGINX error logs I see this line...



*364 peer closed connection in SSL handshake while SSL handshaking to upstream



Below is the config I have for the reverse proxy. (Note, website url and public IP changed to preserve anonymity)



 server
listen 80;
listen [::]:80;
server_name www.mywebsite.com;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass http://192.168.201.235:80/;



server
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

server_name www.mywebsite.com;

ssl_certificate "/etc/pki/nginx/mywebsite.crt";
ssl_certificate_key "/etc/pki/nginx/private/mywebsite.key";

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass https://192.168.201.235:443/;




Is there anything I can do to resolve the bad gateway issue while still connecting securely between the proxy and the target server?



I can connect to the IP address directly over HTTPS, and if I put in another SSL enabled website after proxy_pass it also works.



I have tried searching for an answer to this on google but none of the hits are so far similar enough to my situation to be helpful.










share|improve this question
























  • It’s likely inability to SSL handshake between proxy and 2k3 box. You may have to try enabling different ciphersuites or SSL/TLS levels to find one that will work with older box, though I don’t know if it’s possible to configure internal/external connections differently to avoid compromising security on external connections. I’m pretty sure that Apache reverse proxy can do this but I’ve never used nginx.

    – apocalysque
    13 hours ago






  • 1





    Did you try to use proxy_ssl_protocols TLSv1;? docs.nginx.com/nginx/admin-guide/security-controls/…

    – Lex Li
    10 hours ago












  • @LexLi that worked! Thankyou. If you add it as a reply I will accept it.

    – MrVimes
    9 hours ago











  • @MikaelH You are absolutely right, I should migrate/upgrade/solve this properly, but my hands are a bit tied and I at this stage I am merely seeing if it is at least possible to do this the cheap way.

    – MrVimes
    9 hours ago

















0















I am trying to set up an NGINX server as a reverse proxy to make it possible to connect via TLS 1.2 to an old IIS server that is limited to TLS 1.0



Connection on port 80 works fine. But I get 502 Bad Gateway when I try to connect over https. When I look at the NGINX error logs I see this line...



*364 peer closed connection in SSL handshake while SSL handshaking to upstream



Below is the config I have for the reverse proxy. (Note, website url and public IP changed to preserve anonymity)



 server
listen 80;
listen [::]:80;
server_name www.mywebsite.com;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass http://192.168.201.235:80/;



server
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

server_name www.mywebsite.com;

ssl_certificate "/etc/pki/nginx/mywebsite.crt";
ssl_certificate_key "/etc/pki/nginx/private/mywebsite.key";

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass https://192.168.201.235:443/;




Is there anything I can do to resolve the bad gateway issue while still connecting securely between the proxy and the target server?



I can connect to the IP address directly over HTTPS, and if I put in another SSL enabled website after proxy_pass it also works.



I have tried searching for an answer to this on google but none of the hits are so far similar enough to my situation to be helpful.










share|improve this question
























  • It’s likely inability to SSL handshake between proxy and 2k3 box. You may have to try enabling different ciphersuites or SSL/TLS levels to find one that will work with older box, though I don’t know if it’s possible to configure internal/external connections differently to avoid compromising security on external connections. I’m pretty sure that Apache reverse proxy can do this but I’ve never used nginx.

    – apocalysque
    13 hours ago






  • 1





    Did you try to use proxy_ssl_protocols TLSv1;? docs.nginx.com/nginx/admin-guide/security-controls/…

    – Lex Li
    10 hours ago












  • @LexLi that worked! Thankyou. If you add it as a reply I will accept it.

    – MrVimes
    9 hours ago











  • @MikaelH You are absolutely right, I should migrate/upgrade/solve this properly, but my hands are a bit tied and I at this stage I am merely seeing if it is at least possible to do this the cheap way.

    – MrVimes
    9 hours ago













0












0








0








I am trying to set up an NGINX server as a reverse proxy to make it possible to connect via TLS 1.2 to an old IIS server that is limited to TLS 1.0



Connection on port 80 works fine. But I get 502 Bad Gateway when I try to connect over https. When I look at the NGINX error logs I see this line...



*364 peer closed connection in SSL handshake while SSL handshaking to upstream



Below is the config I have for the reverse proxy. (Note, website url and public IP changed to preserve anonymity)



 server
listen 80;
listen [::]:80;
server_name www.mywebsite.com;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass http://192.168.201.235:80/;



server
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

server_name www.mywebsite.com;

ssl_certificate "/etc/pki/nginx/mywebsite.crt";
ssl_certificate_key "/etc/pki/nginx/private/mywebsite.key";

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass https://192.168.201.235:443/;




Is there anything I can do to resolve the bad gateway issue while still connecting securely between the proxy and the target server?



I can connect to the IP address directly over HTTPS, and if I put in another SSL enabled website after proxy_pass it also works.



I have tried searching for an answer to this on google but none of the hits are so far similar enough to my situation to be helpful.










share|improve this question
















I am trying to set up an NGINX server as a reverse proxy to make it possible to connect via TLS 1.2 to an old IIS server that is limited to TLS 1.0



Connection on port 80 works fine. But I get 502 Bad Gateway when I try to connect over https. When I look at the NGINX error logs I see this line...



*364 peer closed connection in SSL handshake while SSL handshaking to upstream



Below is the config I have for the reverse proxy. (Note, website url and public IP changed to preserve anonymity)



 server
listen 80;
listen [::]:80;
server_name www.mywebsite.com;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass http://192.168.201.235:80/;



server
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

server_name www.mywebsite.com;

ssl_certificate "/etc/pki/nginx/mywebsite.crt";
ssl_certificate_key "/etc/pki/nginx/private/mywebsite.key";

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location /
proxy_set_header Host "www.mywebsite.com";
proxy_pass https://192.168.201.235:443/;




Is there anything I can do to resolve the bad gateway issue while still connecting securely between the proxy and the target server?



I can connect to the IP address directly over HTTPS, and if I put in another SSL enabled website after proxy_pass it also works.



I have tried searching for an answer to this on google but none of the hits are so far similar enough to my situation to be helpful.







nginx ssl windows-server-2003 reverse-proxy iis-6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 6 hours ago









Lex Li

34829




34829










asked 13 hours ago









MrVimesMrVimes

44311127




44311127












  • It’s likely inability to SSL handshake between proxy and 2k3 box. You may have to try enabling different ciphersuites or SSL/TLS levels to find one that will work with older box, though I don’t know if it’s possible to configure internal/external connections differently to avoid compromising security on external connections. I’m pretty sure that Apache reverse proxy can do this but I’ve never used nginx.

    – apocalysque
    13 hours ago






  • 1





    Did you try to use proxy_ssl_protocols TLSv1;? docs.nginx.com/nginx/admin-guide/security-controls/…

    – Lex Li
    10 hours ago












  • @LexLi that worked! Thankyou. If you add it as a reply I will accept it.

    – MrVimes
    9 hours ago











  • @MikaelH You are absolutely right, I should migrate/upgrade/solve this properly, but my hands are a bit tied and I at this stage I am merely seeing if it is at least possible to do this the cheap way.

    – MrVimes
    9 hours ago

















  • It’s likely inability to SSL handshake between proxy and 2k3 box. You may have to try enabling different ciphersuites or SSL/TLS levels to find one that will work with older box, though I don’t know if it’s possible to configure internal/external connections differently to avoid compromising security on external connections. I’m pretty sure that Apache reverse proxy can do this but I’ve never used nginx.

    – apocalysque
    13 hours ago






  • 1





    Did you try to use proxy_ssl_protocols TLSv1;? docs.nginx.com/nginx/admin-guide/security-controls/…

    – Lex Li
    10 hours ago












  • @LexLi that worked! Thankyou. If you add it as a reply I will accept it.

    – MrVimes
    9 hours ago











  • @MikaelH You are absolutely right, I should migrate/upgrade/solve this properly, but my hands are a bit tied and I at this stage I am merely seeing if it is at least possible to do this the cheap way.

    – MrVimes
    9 hours ago
















It’s likely inability to SSL handshake between proxy and 2k3 box. You may have to try enabling different ciphersuites or SSL/TLS levels to find one that will work with older box, though I don’t know if it’s possible to configure internal/external connections differently to avoid compromising security on external connections. I’m pretty sure that Apache reverse proxy can do this but I’ve never used nginx.

– apocalysque
13 hours ago





It’s likely inability to SSL handshake between proxy and 2k3 box. You may have to try enabling different ciphersuites or SSL/TLS levels to find one that will work with older box, though I don’t know if it’s possible to configure internal/external connections differently to avoid compromising security on external connections. I’m pretty sure that Apache reverse proxy can do this but I’ve never used nginx.

– apocalysque
13 hours ago




1




1





Did you try to use proxy_ssl_protocols TLSv1;? docs.nginx.com/nginx/admin-guide/security-controls/…

– Lex Li
10 hours ago






Did you try to use proxy_ssl_protocols TLSv1;? docs.nginx.com/nginx/admin-guide/security-controls/…

– Lex Li
10 hours ago














@LexLi that worked! Thankyou. If you add it as a reply I will accept it.

– MrVimes
9 hours ago





@LexLi that worked! Thankyou. If you add it as a reply I will accept it.

– MrVimes
9 hours ago













@MikaelH You are absolutely right, I should migrate/upgrade/solve this properly, but my hands are a bit tied and I at this stage I am merely seeing if it is at least possible to do this the cheap way.

– MrVimes
9 hours ago





@MikaelH You are absolutely right, I should migrate/upgrade/solve this properly, but my hands are a bit tied and I at this stage I am merely seeing if it is at least possible to do this the cheap way.

– MrVimes
9 hours ago










1 Answer
1






active

oldest

votes


















2














The setting proxy_ssl_protocols seems to control the connection between nginx and the upstream server (Windows Server 2003 in your case),



https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/



Its default setting today might block TLS 1.0, so you need to set proxy_ssl_protocols TLSv1; to enable TLS 1.0.






share|improve this answer























  • Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

    – MrVimes
    9 hours ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962427%2fbad-gateway-when-connecting-to-old-iis-servers-over-ssl-through-nginx-reverse%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














The setting proxy_ssl_protocols seems to control the connection between nginx and the upstream server (Windows Server 2003 in your case),



https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/



Its default setting today might block TLS 1.0, so you need to set proxy_ssl_protocols TLSv1; to enable TLS 1.0.






share|improve this answer























  • Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

    – MrVimes
    9 hours ago















2














The setting proxy_ssl_protocols seems to control the connection between nginx and the upstream server (Windows Server 2003 in your case),



https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/



Its default setting today might block TLS 1.0, so you need to set proxy_ssl_protocols TLSv1; to enable TLS 1.0.






share|improve this answer























  • Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

    – MrVimes
    9 hours ago













2












2








2







The setting proxy_ssl_protocols seems to control the connection between nginx and the upstream server (Windows Server 2003 in your case),



https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/



Its default setting today might block TLS 1.0, so you need to set proxy_ssl_protocols TLSv1; to enable TLS 1.0.






share|improve this answer













The setting proxy_ssl_protocols seems to control the connection between nginx and the upstream server (Windows Server 2003 in your case),



https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/



Its default setting today might block TLS 1.0, so you need to set proxy_ssl_protocols TLSv1; to enable TLS 1.0.







share|improve this answer












share|improve this answer



share|improve this answer










answered 9 hours ago









Lex LiLex Li

34829




34829












  • Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

    – MrVimes
    9 hours ago

















  • Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

    – MrVimes
    9 hours ago
















Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

– MrVimes
9 hours ago





Thankyou again. This worked, and I am able to connect to the website externally over TLS 1.2.

– MrVimes
9 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962427%2fbad-gateway-when-connecting-to-old-iis-servers-over-ssl-through-nginx-reverse%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to make RAID controller rescan devices The 2019 Stack Overflow Developer Survey Results Are InLSI MegaRAID SAS 9261-8i: Disk isn't recognized after replacementHow to monitor the hard disk status behind Dell PERC H710 Raid Controller with CentOS 6?LSI MegaRAID - Recreate missing RAID 1 arrayext. 2-bay USB-Drive with RAID: btrfs RAID vs built-in RAIDInvalid SAS topologyDoes enabling JBOD mode on LSI based controllers affect existing logical disks/arrays?Why is there a shift between the WWN reported from the controller and the Linux system?Optimal RAID 6+0 Setup for 40+ 4TB DisksAccidental SAS cable removal

Куамањотепек (Чилапа де Алварез) Садржај Становништво Види још Референце Спољашње везе Мени за навигацију17°19′47″N 99°1′51″W / 17.32972° СГШ; 99.03083° ЗГД / 17.32972; -99.0308317°19′47″N 99°1′51″W / 17.32972° СГШ; 99.03083° ЗГД / 17.32972; -99.030838877656„Instituto Nacional de Estadística y Geografía”„The GeoNames geographical database”Мексичка насељапроширитиуу

Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time? The 2019 Stack Overflow Developer Survey Results Are InHow is the altitude of a satellite defined, given that the Earth is not spherical?Why do satellites appear to move faster when overhead and slower closer to the horizon?For the mathematical relationship between J2 (km^5/s^2) and dimensionless J2 - which one is derived from the other?Why is Nodal precession affected by the rotational period of the planet?Why is it so difficult to predict the exact reentry location and time of a very low earth orbit object?Why are low earth orbit satellites not visible from the same place all the time?Perifocal coordinates and the orbit equationHow feasible is the Moonspike mission?What was the typical perigee after a shuttle de-orbit burn?I am having trouble calculating my classic orbital elements and am at a loss on where to lookAm I supposed to modify the gravitational constant with scale and why do fps & time scale changes cause my orbit to break?How Local time of a sun synchronous orbit is related to Right ascension of ascending node?What is wrong with my orbit sim equations? How can I fix them?How to obtain the initial positions and velocities of an inclined orbit?