Welcome! Log In Create A New Profile

Advanced

apache rewrite to nginx

Frank Dias
June 12, 2017 04:16PM
I need some help, migrating from Apache to Nginx.
The following logic is in Apache, how do I convert to Nginx

<VirtualHost 172.20.1.145:443>
DocumentRoot "/var/www/default"
ServerName *.diasranch.net
SSLProxyEngine On
ProxyPreserveHost On
RewriteEngine on
RewriteMap host_finder prg:/usr/local/bin/host_finder.php
# Rule to handle the + character in (un)marking a voicemail and Par Cntl
RewriteCond %{HTTP_HOST} ^rwa-(.*) [OR]
RewriteCond %{HTTP_HOST} ^m2m-(.*) [OR]
RewriteCond %{HTTP_HOST} ^dwa-(.*)
RewriteRule ^(/ws/v[1-9]/dias/[^+]*)\+([^+]*)$ https://${host_finder:%{HTTP_HOST}}/$1\%2B$2https://$%7bhost_finder:%25%7bHTTP_HOST%7d%7d/$1/%2B$2 [NE,P,L]
RewriteCond %{HTTP_HOST} ^rwa-(.*) [OR]
RewriteCond %{HTTP_HOST} ^m2m-(.*) [OR]
RewriteCond %{HTTP_HOST} ^dwa-(.*)
RewriteRule ^(/ws/v[1-9]/dias/.*)\+(.*)$ $1\%2B$2 [N,NE]
# The next rule catches everything else and does not use the NE flag
RewriteCond %{HTTP_HOST} ^rwa-(.*) [OR]
RewriteCond %{HTTP_HOST} ^m2m-(.*) [OR]
RewriteCond %{HTTP_HOST} ^dwa-(.*)
RewriteRule ^/(.*) https://${host_finder:%{HTTP_HOST}}/$1https://$%7bhost_finder:%25%7bHTTP_HOST%7d%7d/$1 [P,L]
# The next rule is to defeat TRACE attecks which is a med security CVE
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
ErrorLog logs/ssl_error_log
#TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProxyProtocol all -SSLv2 -SSLv3
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/star.diasranch.net.crt
SSLCertificateKeyFile /etc/pki/tls/private/star.diasranch.net_key.pem
SSLCertificateChainFile /etc/pki/tls/certs/star.diasranch.net.crt
SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1..0 force-response-1.0
#CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x [%r] %b"
CustomLog /dev/null " "
</VirtualHost>

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.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

apache rewrite to nginx

Frank Dias June 12, 2017 04:16PM

Re: apache rewrite to nginx

Aleksandar Lazic June 12, 2017 06:22PM

Re: apache rewrite to nginx

frank3427 June 14, 2017 01:36PM

Re: apache rewrite to nginx

frank3427 June 14, 2017 02:04PM

Re: apache rewrite to nginx

Aleksandar Lazic June 14, 2017 04:28PM

Re: apache rewrite to nginx

frank3427 June 14, 2017 04:45PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready