New on LowEndTalk? Please Register and read our Community Rules.
htaccess - > NGINX
How you translate
RewriteEngine on
RewriteRule ^$ /index.php [L]
RewriteCond $1 !^(index.php|img|css|js|robots.txt|favicon.ico|update.php|install.php)
RewriteRule ^(.*)$ /index.php/$1 [L]
To NGINX syntax.
I'm having problems with NGINX+PHP running Bamboo Invoice.
Comments
location / {
rewrite ^/$ /index.php break;
rewrite ^(.*)$ /index.php/$1 break;
}
http://winginx.com/htaccess
Right, Now the server don't parse the PHP.
Just in case you need a converter, try this :
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
tried both but still getting plain text output or 404.
have you installed the php
Yes, and it worked well. The problem started when I uploaded Bamboo Invoice and noted the URL is index.php/param instead of index.php?param
rewrite ^/$ /index.php break;
rewrite ^(.*)$ /index.php/$1 break;
}
try
location / {
rewrite ^/$ /index.php break;
rewrite ^(.*)$ /index.php?$1 break;
}
If worsts comes to worst you can just install nginx as a proxy for apache.
If you've used the location examples suggested here, there's no directives for loading PHP. You need to structure your location something like this:
OK, I will retry this weekend and see how this works. The plan B is reset all config and start again.
Project Bamboo Invoice aborted. My WordPress site has over 2 days of downtime and I will move it to the VPS.
Interestingly everything works well (until now) with WordPress. Unlike Bamboo.
I'm curious, as nginx is very popular nowaday, why nobody writes a Module or Addon for nginx to compatible with htaccess?
Because htaccess is backwards
Why not a backwards transport for easy migration : )
@name personally I just use
502 Bad Gateway
nginx/0.7.67
juan,
you missed the engine for php script. Are you using nginx with php-fpm?
for .htaccess to nginx conf, please check: http://winginx.com/htaccess
phpMyAdmin works well. The Bad Gateway error is with WordPress on the root of webserver directory.
EDIT:
My fault, I missed a .htaccess file created from the old WordPress install I am migrating to the VPS.
Thanks
No luck, still 502 Bad Gateway.
location {
listen 80;
server_name www.site.com example.org;
if ($http_host = example.org) {
rewrite (.*) http://www.example.org$1;
}
...
}
504 Gateway Time-out
Maybe I need a better VPS if I want to run web with PHP and MySQL.
504->200->502
WordPress frontend 200 OK
Backend 502 Bad Gateway.
Main website working, Wordpress backend still 502 error.
Plan B. Returning to free web host only to handle the scripts. MySQL and some files will remain on the VPS.
Closed case.
Solved, try_files $uri $uri/ /index.php?$args;