Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www-data;
- worker_processes 2;
- pid /run/nginx.pid;
- events {
- worker_connections 768;
- # multi_accept on;
- }
- http {
- ##
- # Basic Settings
- ##
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 30;
- types_hash_max_size 2048;
- server_tokens off;
- client_body_buffer_size 1K;
- client_header_buffer_size 1k;
- client_max_body_size 1m;
- large_client_header_buffers 2 1k;
- client_body_timeout 10;
- client_header_timeout 10;
- send_timeout 10;
- # server_names_hash_bucket_size 64;
- # server_name_in_redirect off;
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- ##
- # Logging Settings
- ##
- access_log off;
- error_log /var/log/nginx/error.log crit;
- ##
- # Gzip Settings
- ##
- gzip on;
- gzip_disable "msie6";
- # gzip_vary on;
- # gzip_proxied any;
- # gzip_comp_level 6;
- # gzip_buffers 16 8k;
- # gzip_http_version 1.1;
- # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
- ##
- # nginx-naxsi config
- ##
- # Uncomment it if you installed nginx-naxsi
- ##
- #include /etc/nginx/naxsi_core.rules;
- ##
- # nginx-passenger config
- ##
- # Uncomment it if you installed nginx-passenger
- ##
- #passenger_root /usr;
- #passenger_ruby /usr/bin/ruby;
- ##
- # Virtual Host Configs
- ##
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-available/*;
- }
- ///// Файл из sites-available для сайта
- server {
- listen 80 default_server;
- listen [::]:80 default_server ipv6only=on;
- root /www/sitefolder;
- index index.php index.html index.htm;
- server_name www.example.com example.com;
- location / {
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- try_files $uri $uri/ =404;
- rewrite ^/(fresh|best|rand|my|search|profile|newstory|added|logout|setnickname)$ /app.php?view=$1 last;
- rewrite ^/story/(.*)$ /app.php?story=$1 last;
- rewrite ^/main /index.php last;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rules
- }
- #location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
- # expires 365d;
- #}
- error_page 404 /404.html;
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- location ~* \.(css|js|png|gif|jpg)$ {
- expires max;
- }
- location ~ \.tpl$ {
- deny all;
- }
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement