-
Notifications
You must be signed in to change notification settings - Fork 2
/
nginx.site.conf
112 lines (94 loc) · 4.27 KB
/
nginx.site.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
# Buffers
client_body_buffer_size 32K;
client_header_buffer_size 32k;
client_max_body_size 64m;
large_client_header_buffers 4 64k;
# Timeouts
client_body_timeout 12;
client_header_timeout 12;
send_timeout 10;
upstream site_backend {
server unix:/var/run/php7-fpm.site.sock1 weight=100 max_fails=5 fail_timeout=5;
server unix:/var/run/php7-fpm.site.sock2 weight=100 max_fails=5 fail_timeout=5;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root WEB_SERVER_ROOT;
index index.php index.html;
access_log /var/www/site/DockerLocal/logs/access.log;
error_log /var/www/site/DockerLocal/logs/error.log info;
location ~ /themes/.*?\.php$ {
return 404;
}
# Not forcing ending slashes ( let cms force ending slashes, or do not use them)
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
# CORS Settings
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' 'Version,Accept,Accept-Encoding,Accept-Language,Connection,Cookie,Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Format,Undelete,X-Api-Key,Debug,X-Forwarded-For,X-Client-Url' always;
include fastcgi.conf;
fastcgi_param SERVER_NAME $host;
fastcgi_pass site_backend;
fastcgi_read_timeout 1200;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff)$ {
expires max;
}
}
server {
listen 443 ssl http2;
listen [::]:443;
server_name _;
ssl_verify_client off;
access_log /var/www/site/DockerLocal/logs/access.log;
error_log /var/www/site/DockerLocal/logs/error.log info;
location /test {
root /var/www/site/html;
index index.php index.html;
}
location /socket.io {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' 'Version,Accept,Accept-Encoding,Accept-Language,Connection,Cookie,Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Format,Undelete,X-Api-Key,Debug,X-Forwarded-For,X-Client-Url' always;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass https://SITE_DOMAIN:SOCKET_PORT;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
proxy_ssl_verify off;
proxy_ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
proxy_ssl_ciphers ALL;
proxy_ssl_session_reuse off;
}
location / {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' 'Version,Accept,Accept-Encoding,Accept-Language,Connection,Cookie,Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Format,Undelete,X-Api-Key,Debug,X-Forwarded-For,X-Client-Url' always;
add_header 'Sec-WebSocket-Key' 'SGVsbG8sIHdvcmxkIQ==';
add_header 'Sec-WebSocket-Version' '13';
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_pass https://SITE_DOMAIN:SOCKET_PORT;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
proxy_ssl_verify off;
proxy_ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
proxy_ssl_ciphers ALL;
proxy_ssl_session_reuse off;
}
ssl on;
ssl_certificate /var/www/site/DockerLocal/ssl-SITE_DOMAIN-cert.pem;
ssl_certificate_key /var/www/site/DockerLocal/ssl-SITE_DOMAIN-key.pem;
}