-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnginx.conf
75 lines (58 loc) · 1.86 KB
/
nginx.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
# For `http` and `websocket` requests
server {
server_name <your_domain>;
root /var/www/soketi-app-manager-filament/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ \.(env|log) {
deny all;
}
location ~ ^/(bootstrap|config|database|overrides|resources|routes|tests|artisan) {
deny all;
}
location ~ ^/(modules|vendor)\/(.*)\.((?!ico|gif|jpg|jpeg|png|js\b|css|less|sass|font|woff|woff2|eot|ttf|svg|xls|xlsx).)*$ {
deny all;
}
location ~ ^/(app|apps)/ {
proxy_pass http://127.0.0.1:6001;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
# SSL config here
}
# For `www` request to redirect to `non-www`
server {
server_name www.<your_domain>;
return 301 https://<your_domain>$request_uri;
# SSL config here
}
# For `http` request to redirect to `https`
server {
listen 80;
listen [::]:80;
server_name <your_domain>;
return 301 https://<your_domain>$request_uri;
}