You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
927 B
44 lines
927 B
12 years ago
|
# WPSUBDIR BASIC NGINX CONFIGURATION
|
||
|
server {
|
||
|
|
||
|
# Uncomment The Following Line For Domain Mapping
|
||
|
# listen 80 default_server;
|
||
|
|
||
|
server_name example.com *.example.com;
|
||
|
|
||
|
# Uncomment The Following Line For Domain Mapping
|
||
12 years ago
|
#server_name_in_redirect off;
|
||
12 years ago
|
|
||
12 years ago
|
access_log /var/log/nginx/example.com.access.log rt_cache;
|
||
12 years ago
|
error_log /var/log/nginx/example.com.error.log;
|
||
|
|
||
|
root /var/www/example.com/htdocs;
|
||
|
index index.php index.htm index.html;
|
||
|
|
||
|
if (!-e $request_filename) {
|
||
|
|
||
|
# Redirect wp-admin To wp-admin/
|
||
|
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||
|
|
||
|
# Redirect wp-* Files/Folders
|
||
|
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
|
||
|
|
||
|
# Redirect Other PHP Files
|
||
|
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
try_files $uri $uri/ /index.php?$args;
|
||
|
}
|
||
|
|
||
|
location ~ \.php$ {
|
||
11 years ago
|
try_files $uri =404;
|
||
12 years ago
|
include fastcgi_params;
|
||
|
fastcgi_pass php;
|
||
|
}
|
||
|
|
||
11 years ago
|
include common/wpcommon.conf;
|
||
|
include common/locations.conf;
|
||
12 years ago
|
|
||
|
}
|