“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

Куамањотепек (Чилапа де Алварез) Садржај Становништво Види још Референце Спољашње везе Мени за навигацију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”Мексичка насељапроширитиуу

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

Срби Садржај Географија Етимологија Генетика Историја Језик Религија Популација Познати Срби Види још Напомене Референце Извори Литература Спољашње везе Мени за навигацијууrs.one.un.orgАрхивираноАрхивирано из оригиналаПопис становништва из 2011. годинеCOMMUNITY PROFILE: SERB COMMUNITY„1996 population census in Bosnia and Herzegovina”„CIA - The World Factbook - Bosnia and Herzegovina”American FactFinder - Results„2011 National Household Survey: Data tables”„Srbi u Nemačkoj | Srbi u Njemačkoj | Zentralrat der Serben in Deutschland”оригинала„Vesti online - Srpski informativni portal”„The Serbian Diaspora and Youth: Cross-Border Ties and Opportunities for Development”оригиналаSerben-Demo eskaliert in Wien„The People of Australia – Statistics from the 2011 Census”„Erstmals über eine Million EU- und EFTA Angehörige in der Schweiz”STANOVNIŠTVO PREMA NARODNOSTI – DETALJNA KLASIFIKACIJA – POPIS 2011.(Завод за статистику Црне Горе)title=Présentation de la République de SerbieSerbian | EthnologuePopulation by ethnic affiliation, Slovenia, Census 1953, 1961, 1971, 1981, 1991 and 2002Попис на населението, домаќинствата и становите во Република Македонија, 2002: Дефинитивни податоциALBANIJA ETNIČKI ČISTI SRBE: Iščezlo 100.000 ljudi pokrštavanjem, kao što su to radile ustaše u NDH! | Telegraf – Najnovije vestiИз удаљене Аргентине„Tab11. Populaţia stabilă după etnie şi limba maternă, pe categorii de localităţi”Суседи броје Србе„Srpska Dijaspora”оригиналаMinifacts about Norway 2012„Statistiques - 01.06.2008”ПРЕДСЕДНИК СРБИЈЕ СА СРБИМА У БРАТИСЛАВИСлавка Драшковић: Многа питања Срба у Црној Гори нерешенаThe Spread of the SlavesGoogle Book„Distribution of European Y-chromosome DNA (Y-DNA) haplogroups by country in percentage”American Journal of Physical Anthropology 142:380–390 (2010)„Архивирана копија”оригинала„Haplogroup I2 (Y-DNA)”„Архивирана копија”оригиналаVTS 01 1 - YouTubeПрви сукоби Срба и Турака - Политикин забавникАрхивираноConstantine Porphyrogenitus: De Administrando ImperioВизантиски извори за историју народа ЈугославијеDe conversione Croatorum et Serborum: A Lost SourceDe conversione Croatorum et Serborum: Изгубљени извор Константина ПорфирогенитаИсторија српске државностиИсторија српског народаСрбофобија и њени извориСерска област после Душанове смртиИсторија ВизантијеИсторија средњовековне босанске државеСрби међу европским народимаСрби у средњем векуМедијиПодациууууу00577267