Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- worker_processes 2; # Default 1
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- keepalive_timeout 65;
- ## Compression
- gzip on;
- gzip_buffers 16 8k;
- gzip_comp_level 9;
- gzip_http_version 1.1;
- gzip_min_length 10;
- gzip_types text/plain text/css application/x-javascript text/xml;
- gzip_vary on;
- gzip_static on; #Needs compilation with gzip_static support
- gzip_proxied any;
- gzip_disable "MSIE [1-6]\.";
- client_max_body_size 300m; //выставляем в соответствии с тем, сколько выставили в php.ini
- server {
- listen 80;
- server_name localhost;
- root /srv/http/;
- index index.php index.html;
- client_body_buffer_size 1m;
- proxy_buffering on;
- proxy_buffer_size 4k;
- proxy_buffers 8 32k;
- # To avoid bandwidth steal
- location ~* \.(js|css|jpg|jpeg|gif|png|svg)$ {
- valid_referers server_names blocked none ;
- if ($invalid_referer) {
- return 403;
- break;
- }
- if (-f $request_filename) {
- expires 35d;
- add_header Cache-Control public;
- break;
- }
- }
- add_header Expires "Tue, 08 Sep 1973 07:00:00 GMT";
- add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
- # This sends the php to Apache, running on port 81
- location / {
- proxy_pass http://localhost:81;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- # redirect server error pages to the static page /50x.html
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement