Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.
server {
listen 80;
server_name host.com;
rewrite ^/$ http://host.com/wp/;
access_log /web/host.com/log/access.log;
location / {
root /web/host.com/default;
index index.php index.html;
# this serves rewrites if the file doesn't exsist
if (!-e $request_filename) {
rewrite ^/wp/(.*)$ /wp/index.php?q=$1 last;
}
}
location ~ .*\.php[345]?$ {
include /etc/nginx/fcgi.conf;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /web/host.com/default$fastcgi_script_name;
}
}
server {
listen 80;
server_name billing.host.com;
client_max_body_size 2m;
access_log /web/host.com/log/access.log;
location / {
root /web/host.com/billing;
index index.php;
}
location ~ .*\.php[345]?$ {
include /etc/nginx/fcgi.conf;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /web/host.com/billing$fastcgi_script_name;
}
}
server {
listen 80;
server_name projects.host.com;
client_max_body_size 2m;
access_log /web/host.com/log/access.log;
location / {
root /web/host.com/projects;
index index.php;
if (!-e $request_filename) {
rewrite ^/([0-9]+)$ /index.php?go=itemView&id=$1 last;
rewrite ^/([a-zA-Z]+)$ /index.php?go=globalView&id=$1 last;
}
}
location ~ .*\.php[345]?$ {
include /etc/nginx/fcgi.conf;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /web/host.com/projects$fastcgi_script_name;
}
}
chown -R www-data.www-data /path/to/wp
chmod -R u+rw /path/to/wp
chmod -R g+rw /path/to/wp
chmod -R o-rwx /path/to/wp
server {
listen 80;
server_name host.com;
access_log /web/host.com/log/access.log;
location / {
root /web/host.com/default;
index index.php index.html; #<------- ***HERE***
# this serves static files that exist without running other rewrite tests
if (!-e $request_filename) {
rewrite ^/wp/(.*)$ /wp/index.php?q=$1 last;
}
}
location ~ .*\.php[345]?$ {
include /etc/nginx/fcgi.conf;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php; #<------- ***HERE***
fastcgi_param SCRIPT_FILENAME /web/host.com/default$fastcgi_script_name;
}
}Emailed By: sfong15Nginx is actually doing rewrite to url, i.e. from host.com -> host.com/wp/ is it possible to make url prettier, e.g. visitor is actually seeing url of host.com and making root of this domain at .../wp/, as in Apache?
rewrite ^/$ http://host.com/wp/;root /var/www/nginx-default;
change to
root /var/www/nginx-default/wp;rewrite ^/wp/(.*)$ /wp/index.php?q=$1 last;
change to
rewrite ^/(.*)$ /index.php?q=$1 last;fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
change to
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default/wp$fastcgi_script_name;1 to 20 of 20