-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault-7.2
169 lines (145 loc) · 5.25 KB
/
default-7.2
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
map $http_host $blogid {
default 0;
}
# Check if client is capable of handling webp
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
# Capture image path, without the file extension
map $uri $image {
~*^/?(wp-content)/(.+)\.(png|jpe?g)$ $1/$2;
}
server {
listen 80;
listen [::]:80;
client_max_body_size 200M;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
try_files $uri $uri/ /index.php?q=$uri&$args;
#server_name *;
location ~ ^(/[^/]+/)?files/(.+) {
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ;
access_log off; log_not_found off; expires max;
}
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}
location / {
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?q=$uri&$args =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.1-fpm.sock;
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
# fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
add_header Vary Accept;
if ($http_accept !~* "webp"){
break;
}
# #add_header X-debug-message $image$webp_suffix always;
try_files /$image$webp_suffix $uri =404;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
# server {
# listen 80;
# listen [::]:80;
# #server_name *;
# #return 302 https://$server_name$request_uri;
# #rewrite ^(.*) $host$1 permanent;
# return 301 https://$host$request_uri;
# client_max_body_size 200M;
# proxy_connect_timeout 600;
# proxy_send_timeout 600;
# proxy_read_timeout 600;
# send_timeout 600;
# # SSL configuration
# #
# # listen 443 ssl default_server;
# # listen [::]:443 ssl default_server;
# #
# # Note: You should disable gzip for SSL traffic.
# # See: https://bugs.debian.org/773332
# #
# # Read up on ssl_ciphers to ensure a secure configuration.
# # See: https://bugs.debian.org/765782
# #
# # Self signed certs generated by the ssl-cert package
# # Don't use them in a production server!
# #
# # include snippets/snakeoil.conf;
# root /var/www/html;
# # Add index.php to the list if you are using PHP
# index index.php index.html index.htm index.nginx-debian.html;
# try_files $uri $uri/ /index.php?q=$uri&$args;
# location / {
# if (!-e $request_filename) {
# rewrite ^.*$ /index.php last;
# }
# # First attempt to serve request as file, then
# # as directory, then fall back to displaying a 404.
# try_files $uri $uri/ /index.php?q=$uri&$args =404;
# }
# # pass PHP scripts to FastCGI server
# #
# location ~ \.php$ {
# include snippets/fastcgi-php.conf;
# #
# # # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/run/php/php7.4-fpm.sock;
# # # With php-cgi (or other tcp sockets):
# # fastcgi_pass 127.0.0.1:9000;
# }
# location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
# #add_header Vary Accept;
# #expires 365d;
# #if ($http_accept !~* "webp"){
# # break;
# #}
# try_files
# $request_filename.webp
# #$uri
# =404;
# }
# # deny access to .htaccess files, if Apache's document root
# # concurs with nginx's one
# #
# location ~ /\.ht {
# deny all;
# }
# #return 302 https://$server_name$request_uri;
# }