forked from givanz/Vvveb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-docker.conf
124 lines (99 loc) · 3.3 KB
/
nginx-docker.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
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
server {
listen 0.0.0.0:80;
#listen 80 server;
#listen [::]:80 server;
#listen 443 ssl http2;
#listen [::]:443 ssl http2;
#ssl_certificate /etc/letsencrypt/live/vvveb.com/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/vvveb.com/privkey.pem;
#ssl_session_cache shared:SSL:20m;
#ssl_session_timeout 10m;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_prefer_server_ciphers on;
#ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html/public;
index index.php index.html;
error_page 404 /index.php;
gzip on;
gzip_vary on;
gzip_min_length 10240;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
#charset utf-8;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
set $skip_cache 0;
set $cache_uri $request_uri;
if ($query_string != "") {
set $skip_cache 1;
set $cache_uri null;
}
# Don't cache uris containing the following segments
if ($request_uri ~* "/admin/|/user/|/cart/|/feed/|index.php|sitemap(_index)?.xml") {
set $skip_cache 1;
set $cache_uri null;
}
# Don't use the cache for logged in users or if products in cart
if ($http_cookie ~* "nocache|cart|user") {
set $skip_cache 1;
set $cache_uri null;
}
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $skip_cache 1;
set $cache_uri null;
}
#static files
#error_page 404 /index.php;
#error_page 404 /404.html;
location = /favicon.ico {
log_not_found off;
access_log off;
}
#add domain to sitemaps for multisite
location = /robots.txt {
log_not_found off;
access_log off;
try_files $uri /index.php$is_args$args;
}
#static files
location ~* "\.(?!php)([\w]{3,5})$" {
expires max;
log_not_found off;
sendfile on;
sendfile_max_chunk 1m;
fastcgi_hide_header "Set-Cookie";
try_files $uri =404;
}
location / {
default_type text/html;
index index.php index.html index.htm;
try_files /page-cache/$host$cache_uri /page-cache/$host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
#try_files $uri $uri/ /index.php$is_args$args;
#cache debug
#add_header "uri" $cache_uri;
#add_header "skip_cache" $skip_cache;
location ~ /media/.+?\.php$ {
deny all;
}
location ~ \.php$ {
# try_files $uri =404;
#fastcgi_pass unix:/var/run/php-fpm83/php-fpm.pid;
#fastcgi_pass php:9000;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
}
location ~ /\.(?!well-known).* {
deny all;
}
}