-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.example
More file actions
45 lines (38 loc) · 1.31 KB
/
nginx.example
File metadata and controls
45 lines (38 loc) · 1.31 KB
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
server {
root public;
index index.php index.html index.htm;
server_name example.com;
listen [::]:80;
client_max_body_size 20M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /app/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:9001; # WebSocket server address
}
location /apps/ {
proxy_pass http://127.0.0.1:9001; # WebSocket server address
}
location /up {
proxy_pass http://127.0.0.1:9001; # WebSocket server address
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 365d;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_HOST $server_name;
}
}