Welcome! Log In Create A New Profile

Advanced

Need help converting apache rewrite rules to nginx

Posted by raz143 
Need help converting apache rewrite rules to nginx
December 12, 2015 06:43AM
Hey guys!
I'm new here. Hope you could help me out with a small problem.
I'm trying to migrate a site to nginx, but some parts of it don't work properly due to missing rewrite rules.
On my Apache vhost config, I got this:

<Directory ${DOCUMENT_ROOT}>
AllowOverride All
Require all granted

RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
RewriteRule \.php$ - [R=404]
</Directory>

RewriteEngine On
RewriteCond %{HTTP:Authorization} .+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Could you please give me the nginx equilivant to those rewrite rules? (Including the ones in the <directory> directive of course)
Re: Need help converting apache rewrite rules to nginx
December 12, 2015 07:20AM
Reading through these will make you also understand how to convert and how it works:

https://www.digitalocean.com/community/tutorials/how-to-migrate-from-an-apache-web-server-to-nginx-on-an-ubuntu-vps
http://blog.donnywals.com/how-i-migrated-from-apache-to-nginx/

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 179
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready