Mitesh Shah
12 years ago
2 changed files with 49 additions and 0 deletions
@ -0,0 +1,42 @@ |
|||
# 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 |
|||
server_name_in_redirect off; |
|||
|
|||
access_log /var/log/nginx/example.com.access.log; |
|||
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$ { |
|||
try_files $uri /index.php; |
|||
include fastcgi_params; |
|||
fastcgi_pass php; |
|||
} |
|||
|
|||
include /etc/nginx/common/locations.conf; |
|||
|
|||
} |
Loading…
Reference in new issue