-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.wordpress.subdirectory.conf
46 lines (38 loc) · 1.11 KB
/
nginx.wordpress.subdirectory.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#Wordpress with subfolder
server {
listen 80;
server_name .___-.___;
root ___;
index index.php index.html index.htm;
error_page 404 = /404.html;
location / {
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?q=$1 last;
}
}
location /subfolder {
alias /subfolder/;
if (!-e $request_filename) {
rewrite ^/subfolder/(.+)$ /subfolder/index.php?q=$1 last;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
location ~ ^/assets/(img|js|css|fonts)/(.*)$ {
try_files $uri $uri/ /wp-content/themes/___/assets/$1/$2;
}
location ~ ^/plugins/(.*)$ {
try_files $uri $uri/ /wp-content/plugins/$1;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}