mirror of
https://github.com/YunoHost-Apps/jump_ynh.git
synced 2024-09-03 20:36:28 +02:00
102 lines
2.7 KiB
Nginx Configuration File
102 lines
2.7 KiB
Nginx Configuration File
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
|
location __PATH__/ {
|
|
|
|
# Path to source
|
|
alias __INSTALL_DIR__/;
|
|
|
|
### Example PHP configuration (remove it if not used)
|
|
sendfile off;
|
|
absolute_redirect off;
|
|
|
|
# Hide nginx server tokens and version number
|
|
server_tokens off;
|
|
|
|
index index.php;
|
|
#listen [::]:8080;
|
|
#listen 8080;
|
|
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
|
# client_max_body_size 50M;
|
|
|
|
try_files $uri $uri/ index.php;
|
|
#location ~ [^/]\.php(/|$) {
|
|
#fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
#fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
|
|
|
#fastcgi_index index.php;
|
|
#include fastcgi_params;
|
|
#fastcgi_param REMOTE_USER $remote_user;
|
|
#fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
#fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
#} \.php$
|
|
|
|
location ~ [^/]\.php(/|$) {
|
|
include fastcgi_params;
|
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
|
fastcgi_index index.php;
|
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
#fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
fastcgi_param REMOTE_USER $remote_user;
|
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
}
|
|
### End of PHP configuration part
|
|
|
|
|
|
# Tell browsers to cache static assets
|
|
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml|svg)$ {
|
|
expires 3d;
|
|
}
|
|
|
|
# Deny access to dot files
|
|
location ~ /\. {
|
|
log_not_found off;
|
|
deny all;
|
|
}
|
|
|
|
# Deny yaml, twig, markdown, ini file access.
|
|
location ~* /.+\.(markdown|md|twig|yaml|yml|ini)$ {
|
|
deny all;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Deny all grunt, package files.
|
|
location ~* (Gruntfile|package)\.(js|json|jsonc)$ {
|
|
deny all;
|
|
log_not_found off;
|
|
}
|
|
# Deny all composer files.
|
|
location ~* composer\. {
|
|
deny all;
|
|
log_not_found off;
|
|
}
|
|
|
|
## Deny vendor directory.
|
|
location ^~ __PATH__/vendor/ {
|
|
deny all;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Allow fpm ping from localhost, useful for docker HEALTHCHECK.
|
|
location ~ ^/(fpm-ping)$ {
|
|
access_log off;
|
|
allow 127.0.0.1;
|
|
deny all;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
include fastcgi_params;
|
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
|
#unix:/run/php-fpm.sock;
|
|
#unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__*.sock;
|
|
}
|
|
|
|
# Gzip compression options
|
|
gzip on;
|
|
gzip_proxied any;
|
|
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
|
|
gzip_vary on;
|
|
gzip_disable "msie6";
|
|
|
|
|
|
# Include SSOWAT user panel.
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
}
|
|
|