{"id":1598,"date":"2013-04-04T15:59:28","date_gmt":"2013-04-04T15:59:28","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1598"},"modified":"2013-04-04T16:24:02","modified_gmt":"2013-04-04T16:24:02","slug":"example-nginx-ssl-reverse-proxy-config","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1598","title":{"rendered":"Example nginx SSL Reverse Proxy config"},"content":{"rendered":"<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"text codecolorer\">user &nbsp;nginx;<br \/>\nworker_processes &nbsp;1;<br \/>\n<br \/>\nerror_log &nbsp;\/var\/log\/nginx\/error.log warn;<br \/>\npid &nbsp; &nbsp; &nbsp; &nbsp;\/var\/run\/nginx.pid;<br \/>\n<br \/>\n<br \/>\nevents {<br \/>\n&nbsp; &nbsp; worker_connections &nbsp;1024;<br \/>\n}<br \/>\n<br \/>\n<br \/>\nhttp {<br \/>\n&nbsp; upstream proxy {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; server 10.150.161.22:8080;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; server {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;listen 8443;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;server_name 195.69.213.78;<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ssl on;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ssl_certificate ssl\/test.crt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ssl_certificate_key ssl\/test.key;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ssl_session_cache shared:SSL:10m;<br \/>\n<br \/>\n&nbsp; &nbsp; location \/ {<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_pass http:\/\/proxy; # my existing apache instance<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header X-Forwarded-For $remote_addr; # Strip and add a clean forwarded for header<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; # re-write redirects to http as to https, example: \/home<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_redirect http:\/\/ https:\/\/;<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp; }<br \/>\n}<br \/>\n<br \/>\nhttp {<br \/>\n&nbsp; upstream proxy {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; server 10.150.161.22:80;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; server {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;listen 8080;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;server_name 195.69.213.78;<br \/>\n<br \/>\n&nbsp; &nbsp; location \/ {<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_pass http:\/\/proxy; # my existing apache instance<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header X-Forwarded-For $remote_addr;<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; # re-write redirects to http as to https, example: \/home<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; #proxy_redirect http:\/\/ https:\/\/<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp; }<br \/>\n}<br \/>\n<br \/>\nhttp {<br \/>\n&nbsp; upstream proxy {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; server ukstrosxsus01.pearson.com:8088;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; server {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;listen 8088;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;server_name 195.69.213.78;<br \/>\n<br \/>\n&nbsp; &nbsp; location \/ {<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_pass http:\/\/proxy; # my existing apache instance<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header X-Forwarded-For $remote_addr;<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; # re-write redirects to http as to https, example: \/home<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; #proxy_redirect http:\/\/ https:\/\/<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp;}<br \/>\n}<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>user &nbsp;nginx; worker_processes &nbsp;1; error_log &nbsp;\/var\/log\/nginx\/error.log warn; pid &nbsp; &nbsp; &nbsp; &nbsp;\/var\/run\/nginx.pid; events { &nbsp; &nbsp; worker_connections &nbsp;1024; } http { &nbsp; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1598","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1598","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1598"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1598\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}