mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 04:07:07 +09:00
65 lines
1.8 KiB
Nginx Configuration File
65 lines
1.8 KiB
Nginx Configuration File
# We've moved the nginx configuration file to our new configuration generator tool. It now is easier to generate a configuraiton file for your web server:
|
|
#
|
|
# https://config.fossbilling.org/
|
|
server {
|
|
listen 80;
|
|
|
|
set $root_path '/var/www/fossbilling/src';
|
|
server_name fossbilling.vm www.fossbilling.vm;
|
|
|
|
index index.html index.htm index.php;
|
|
root $root_path;
|
|
try_files $uri $uri/ @rewrite;
|
|
sendfile off;
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
# Block access to sensitive files and return 404 to make it indistinguishable from a missing file
|
|
location ~* .(ini|sh|inc|bak|twig|sql)$ {
|
|
return 404;
|
|
}
|
|
|
|
# Block access to hidden files except .well-known
|
|
location ~ /\.(?!well-known\/) {
|
|
return 404;
|
|
}
|
|
|
|
# Disable PHP execution in /uploads
|
|
location ~* /uploads/.*\.php$ {
|
|
return 404;
|
|
}
|
|
|
|
# Deny access to /data
|
|
location ~* /data/ {
|
|
return 404;
|
|
}
|
|
|
|
location @rewrite {
|
|
rewrite ^/page/(.*)$ /index.php?_url=/custompages/$1;
|
|
rewrite ^/(.*)$ /index.php?_url=/$1;
|
|
}
|
|
|
|
location ~ \.php {
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
|
|
# fastcgi_pass need to be changed according your server setup:
|
|
# phpx.x is your server setup
|
|
# examples: /var/run/phpx.x-fpm.sock, /var/run/php/phpx.x-fpm.sock or /run/php/phpx.x-fpm.sock are all valid options
|
|
# Or even localhost:port (Default 9000 will work fine)
|
|
# Please check your server setup
|
|
|
|
fastcgi_pass unix:/run/php/phpx.x-fpm.sock
|
|
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_intercept_errors on;
|
|
|
|
include fastcgi_params;
|
|
}
|
|
|
|
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
|
|
root $root_path;
|
|
expires off;
|
|
}
|
|
}
|