Jump to content
IPS Community Suite 简体中文
Sign in to follow this  
ipscn

IPS Nginx Rules

Recommended Posts

### yoursite.com

server {
access_log off;
error_log  logs/yoursite.com-error_log warn;

listen 80;
        server_name  yoursite.com www.yoursite.com;

# static file configuration
location ~* .(gif|jpg|jpeg|png|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|wml|swf)$ {
root   /var/www/yoursite.com;
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

# site configuration
        location / {
        root   /var/www/yoursite.com;
        index  index.php index.html index.htm;

        # IPB configuration
try_files $uri $uri/ /index.php?q=$uri&$args;
}

# php-fpm configuration
        location ~ .php$ {
            root           /var/www/yoursite.com;
            try_files $uri =404;
            fastcgi_pass   unix:/tmp/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 256 4k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
        }

}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×