Skip to content

Instantly share code, notes, and snippets.

@Great-Antique
Forked from jsifalda/common.conf
Last active August 19, 2021 02:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Great-Antique/9230151 to your computer and use it in GitHub Desktop.
Save Great-Antique/9230151 to your computer and use it in GitHub Desktop.
Nginx configuration for web application powered by Nette framework
# Please paste to folder common/common.conf
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
#location ~ \.(js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ { }
location ~ /\.(ht|gitignore) { # deny access to .htaccess files, if Apache's document root concurs with nginx's one
deny all;
}
location ~ \.(neon|ini|log|yml)$ { # deny access to configuration files
deny all;
}
location = /robots.txt { access_log off; log_not_found off; }
location = /humans.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
fastcgi_buffers 8 16k; fastcgi_buffer_size 32k;
client_max_body_size 45M;
client_body_buffer_size 128k;
# Please paste to folder common/nette.conf
try_files $uri $uri/ /index.php?$args;
server {
listen 80;
server_name nette.dev;
charset utf-8;
root /home/user/www/nette/sandbox/www;
error_log /var/log/php/nette.error.log;
access_log /var/log/php/nette.access.log;
include common/common.conf;
include common/php.conf;
include common/nette.conf;
}
# Please paste to folder common/php.conf
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;
fastcgi_connect_timeout 1800;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment