forked from pmsf/PMSF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.example.conf
72 lines (60 loc) · 1.87 KB
/
nginx.example.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
server {
listen 80;
server_name DOMAINNAME;
# Some Basic lockdown of folders and files
# Lock folders
location ~ /(\.|cron|lib|LICENSE|config|scripts)
{
return 444;
}
# Lock Extensions
location ~* \.(conf|md|sql|sh|back|backup)
{
return 444;
}
rewrite ^/raw_data$ /raw_data.php?$1 last;
rewrite ^/motd_data$ /motd_data.php?$1 last;
rewrite ^/submit /submit.php?$1 last;
rewrite ^/search /search.php?$1 last;
rewrite ^/weather_data$ /weather_data.php?$1 last;
rewrite ^/serviceWorker.min.js$ /static/dist/js/serviceWorker.min.js last;
rewrite ^/user$ /user.php?$1 last;
rewrite ^/discord-login$ /discord-login.php?$1 last;
#charset koi8-r;
error_log /var/log/nginx/error.log warn;
#access_log logs/host.access.log main;
location / {
include /etc/nginx/mime.types;
root /PATH/TO/PMSF;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /PATH/TO/PMSF;
try_files $uri =404;
fastcgi_pass unix:/var/run/php-main.socket;
fastcgi_index index.php;
fastcgi_param HTTP_IF_NONE_MATCH $http_if_none_match;
fastcgi_param HTTP_IF_MODIFIED_SINCE $http_if_modified_since;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}