nginx配置文件
sockstat 查看所有端口
server
{
listen 80;
server_name www.bghome.com;
index index.php index.html index.htm;
root /data/www/bighome/myhome/www;
autoindex on;
large_client_header_buffers 4 16k;
client_max_body_size 300m;
client_body_buffer_size 128k;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy\_set\_header Host $host;
proxy\_set\_header X-Real-IP $remote\_addr;
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;
if ($host = 'bghome.com' ) \{
rewrite ^/(.\*)$ http://www.bghome.com/$1 permanent;
\}
location = /favicon.ico \{
root /data/www/bighome/myhome/www;
\}
\# Deny all attempts to access hidden files such as .htaccess, .htpasswd,.DS\_Store(Mac).
location ~ /\\. \{
deny all;
\}
location ~\* /(?:uploads|files)/.\*\\.php$ \{
deny all;
\}
location / \{
try\_files $uri $uri/ /index.php?$args;
proxy\_pass http://127.0.0.1:9000;
proxy\_read\_timeout 300;
proxy\_set\_header Host $host;
proxy\_set\_header X-Real-IP $remote\_addr;
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;
\}
location ~\* ^.+\\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|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;
\}
location ~\* \\.(js|css|png|jpg|jpeg|gif|ico)$ \{
expires 24h;
log\_not\_found off;
\}
error\_page 404 /404.html;
error\_page 500 502 503 504 /50x.html;
location = /50x.html \{
root /usr/share/nginx/html;
\}
location ~\* \\.(eot|otf|ttf|woff)$ \{
add\_header Access-Control-Allow-Origin \*;
\}
location ~ \\.php
\{
fastcgi\_index index.php;
fastcgi\_pass 127.0.0.1:9000;
\#fastcgi\_pass unix:/var/run/php-fpm/php-fpm55.sock;
include fastcgi\_params;
set $path\_info "";
set $real\_script\_name $fastcgi\_script\_name;
if ($fastcgi\_script\_name ~ "^(.+?\\.php)(/.+)$") \{
set $real\_script\_name $1;
set $path\_info $2;
\}
fastcgi\_param SCRIPT\_FILENAME $document\_root$real\_script\_name;
fastcgi\_param SCRIPT\_NAME $real\_script\_name;
fastcgi\_param PATH\_INFO $path\_info;
}
#location ~ ^(.+\.php)(.*)$
#{
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# fastcgi_index index.php;
# fastcgi_pass 127.0.0.1:9000;
# #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
# include fastcgi_params;
#}
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /var/www;
#}
#include location.conf;
}
还没有评论,来说两句吧...