mirror of
https://github.com/devfake/flox.git
synced 2024-11-14 14:12:31 +01:00
e90bb4adc0
Propose a working NGINX configuration sample.
66 lines
1.7 KiB
Nginx Configuration File
66 lines
1.7 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name example.com;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name example.com;
|
|
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
|
|
root /usr/share/webapps/flox/public/;
|
|
index index.php index.html index.htm;
|
|
charset utf-8;
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_disable "msie6";
|
|
gzip_comp_level 6;
|
|
gzip_min_length 1100;
|
|
gzip_buffers 16 8k;
|
|
gzip_proxied any;
|
|
gzip_types
|
|
text/plain
|
|
text/css
|
|
text/js
|
|
text/xml
|
|
text/javascript
|
|
application/javascript
|
|
application/x-javascript
|
|
application/json
|
|
application/xml
|
|
application/xml+rss;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri /index.php =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)\$;
|
|
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
include fastcgi_params;
|
|
}
|
|
|
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)\$ {
|
|
expires 1M;
|
|
access_log off;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
location ~* \.(?:css|js)\$ {
|
|
expires 7d;
|
|
access_log off;
|
|
add_header Cache-Control "public";
|
|
}
|
|
|
|
location ~ /\.ht {
|
|
deny all;
|
|
}
|
|
|
|
error_log /var/log/nginx/flox_error.log;
|
|
access_log /var/log/nginx/flox_access.log;
|
|
}
|