<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I need some help, migrating from Apache to Nginx.<o:p></o:p></p>
<p class="MsoNormal">The following logic is in Apache, how do I convert to Nginx<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><VirtualHost 172.20.1.145:443><o:p></o:p></p>
<p class="MsoNormal">DocumentRoot "/var/www/default"<o:p></o:p></p>
<p class="MsoNormal">ServerName *.diasranch.net<o:p></o:p></p>
<p class="MsoNormal">SSLProxyEngine On<o:p></o:p></p>
<p class="MsoNormal">ProxyPreserveHost On<o:p></o:p></p>
<p class="MsoNormal">RewriteEngine on<o:p></o:p></p>
<p class="MsoNormal">RewriteMap host_finder prg:/usr/local/bin/host_finder.php<o:p></o:p></p>
<p class="MsoNormal"># Rule to handle the + character in (un)marking a voicemail and Par Cntl<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^rwa-(.*) [OR]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^m2m-(.*) [OR]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^dwa-(.*)<o:p></o:p></p>
<p class="MsoNormal">RewriteRule ^(/ws/v[1-9]/dias/[^+]*)\+([^+]*)$ <a href="https://$%7bhost_finder:%25%7bHTTP_HOST%7d%7d/$1/%2B$2">
https://${host_finder:%{HTTP_HOST}}/$1\%2B$2</a> [NE,P,L]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^rwa-(.*) [OR]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^m2m-(.*) [OR]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^dwa-(.*)<o:p></o:p></p>
<p class="MsoNormal">RewriteRule ^(/ws/v[1-9]/dias/.*)\+(.*)$ $1\%2B$2 [N,NE]<o:p></o:p></p>
<p class="MsoNormal"># The next rule catches everything else and does not use the NE flag<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^rwa-(.*) [OR]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^m2m-(.*) [OR]<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{HTTP_HOST} ^dwa-(.*)<o:p></o:p></p>
<p class="MsoNormal">RewriteRule ^/(.*) <a href="https://$%7bhost_finder:%25%7bHTTP_HOST%7d%7d/$1">
https://${host_finder:%{HTTP_HOST}}/$1</a> [P,L]<o:p></o:p></p>
<p class="MsoNormal"># The next rule is to defeat TRACE attecks which is a med security CVE<o:p></o:p></p>
<p class="MsoNormal">RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)<o:p></o:p></p>
<p class="MsoNormal">RewriteRule .* - [F]<o:p></o:p></p>
<p class="MsoNormal">ErrorLog logs/ssl_error_log<o:p></o:p></p>
<p class="MsoNormal">#TransferLog logs/ssl_access_log<o:p></o:p></p>
<p class="MsoNormal">LogLevel warn<o:p></o:p></p>
<p class="MsoNormal">SSLEngine on<o:p></o:p></p>
<p class="MsoNormal">SSLProxyProtocol all -SSLv2 -SSLv3<o:p></o:p></p>
<p class="MsoNormal">SSLProtocol all -SSLv2 -SSLv3<o:p></o:p></p>
<p class="MsoNormal">SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW<o:p></o:p></p>
<p class="MsoNormal">SSLCertificateFile /etc/pki/tls/certs/star.diasranch.net.crt<o:p></o:p></p>
<p class="MsoNormal">SSLCertificateKeyFile /etc/pki/tls/private/star.diasranch.net_key.pem<o:p></o:p></p>
<p class="MsoNormal">SSLCertificateChainFile /etc/pki/tls/certs/star.diasranch.net.crt<o:p></o:p></p>
<p class="MsoNormal">SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt<o:p></o:p></p>
<p class="MsoNormal">SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0<o:p></o:p></p>
<p class="MsoNormal">#CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x [%r] %b"<o:p></o:p></p>
<p class="MsoNormal">CustomLog /dev/null " " <o:p></o:p></p>
<p class="MsoNormal"></VirtualHost><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
This message is confidential to Prodea unless otherwise indicated or apparent from its nature. This message is directed to the intended recipient only, who may be readily determined by the sender of this message and its contents. If the reader of this message
 is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient:(a)any dissemination or copying of this message is strictly prohibited; and(b)immediately notify the sender by return message and destroy
 any copies of this message in any form(electronic, paper or otherwise) that you have.The delivery of this message and its information is neither intended to be nor constitutes a disclosure or waiver of any trade secrets, intellectual property, attorney work
 product, or attorney-client communications. The authority of the individual sending this message to legally bind Prodea is neither apparent nor implied,and must be independently verified.
</body>
</html>