nginx-app/nginx.conf

80 lines
2.6 KiB
Nginx Configuration File

user cloudron;
worker_processes 1;
error_log /dev/stderr;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
server {
listen 8000;
root /app/data/public;
index index.php index.html index.htm;
try_files $uri $uri/index.html $uri/ =404;
absolute_redirect off;
# Uncomment to add a redirect
#return 302 $scheme://WWW.REDIRECT.TO.COM$request_uri;
# Uncomment to enable PHP
#location ~ \.php$ {
# try_files $uri =404;
# fastcgi_pass unix:/var/run/php-fpm.sock;
# fastcgi_index index.php;
# fastcgi_param GATEWAY_INTERFACE CGI/1.1;
# fastcgi_param SERVER_SOFTWARE nginx;
# fastcgi_param QUERY_STRING $query_string;
# fastcgi_param REQUEST_METHOD $request_method;
# fastcgi_param CONTENT_TYPE $content_type;
# fastcgi_param CONTENT_LENGTH $content_length;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param SCRIPT_NAME $fastcgi_script_name;
# fastcgi_param REQUEST_URI $request_uri;
# fastcgi_param DOCUMENT_URI $document_uri;
# fastcgi_param DOCUMENT_ROOT $document_root;
# fastcgi_param SERVER_PROTOCOL $server_protocol;
# fastcgi_param REMOTE_PORT $remote_port;
# fastcgi_param SERVER_ADDR $server_addr;
# fastcgi_param SERVER_PORT $server_port;
# fastcgi_param SERVER_NAME $server_name;
# fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
# fastcgi_param REMOTE_ADDR $http_x_real_ip;
#}
# Disallow .htaccess .htpasswd etc.
location ~ /\.ht {
deny all;
}
# Cache statif files
location ~* \.html$ {
expires 1h;
}
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|mp3|ttf|css|rss|atom|js|jpg|jpeg|webp|webm|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)(\?.+)?$ {
access_log off;
log_not_found off;
expires max;
}
}
}