New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Nginx users
cosmicgate
Member
How do you deal with broken links from functions or scripts that rely on the mod_rewrite module?
Comments
Custom 404 page set to the index.php page or just use http://wiki.nginx.org/HttpRewriteModule
http://wiki.nginx.org/HttpRewriteModule looks very complicated. Where exactly do i put those codes into? Index.php/index.html?
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
very nice tool. Where do i put the converted code? Replace it into .htaccess file?
it goes in your nginx config file, in the "server" block for the website the rules apply to.
Nginx does not use .htaccess files because .htaccess, according to the nginx developers, is slow. This was not posted for a 10 page Apache vs nginx discussion, just stating why the developers of nginx do not use .htaccess
that didn't work. When i put it into the individual domain vhost nginx config file under the server block it broke the whole nginx and wouldn't start.
sad but true. Time to move back to apache. sigh.
You could hire some guy for $5 on some rentacoder site or even Fiverr for you to make custom rewrites for nginx
What made you want to switch from Apache to nginx? Speed? Resource consumption?
If the reason is because Apache chokes on connections, setup a nginx reverse proxy which makes the connection to localhost:8000 where Apache is listening. Nginx reverse proxy is pretty normal and well documented online
that might work. So just to get your method right,
scenario: 1 IP, multiple domain names. Vhosts set at nginx
1)Nginx set at port 80 and set as reverse proxy for domain X
location / {
proxy_pass http://127.0.0.1:8000;
include /etc/nginx/proxy.conf;
2)setup apache to listen at port 8000. How do i setup apache to only accept domain X connection? Do i need to setup virtual hosts too? Remember i have a couple domains, only domain x need to go through nginx as reverse proxy and to apache. I do not want it to use the default /var/www folder, instead i want it to use individual folder such as vhost1 /var/www/vhost1 for domain x, vhost2 /var/www/vhost2 for domain y.
it sounds like it involves a lot of work.
You don't sound like you're fit for any of that 'lots of work'.
Go hire an Indian or two off of Fiverr for $5, shouldn't take more than 5 mins for this.
What script are you trying to make run on Nginx? Perhaps someone here has already crossed that bridge and can help you (unless it's some really esoteric stuff)
@cosmicgate mod_rewrite on Nginx??
In case, if you migrate from "Apache .htaccess", some kind of basic tricks is to follow these rules:
I've many configured site/CMS with Nginx HttpRewriteModule, such as wordpress, phpbb, joomla, rapidleech, etc..
The matter how you write those "Nginx HttpRewriteModule" may seem complicated, but they don’t have to be.
:-)
This is why I tend to use Nginx as a proxy to apache. It avoids such headaches and accelerates apache.
In Nginx rewrite rules (these must always be terminated by a ; [semicolon]).
finally got it working by following those tip!
This is why I don't use php and any software written in it, relying on specific webserver - apache.
Pretty wide assumption based on a few scripts.
I agree. I know a lot of PHP scripts that dont require apache.