技术解析
环境是用 oneinstck 做的
域名 10.0531.tw 不正常 10.0531.tw:5000 正常
大神们帮我看看应该怎么处理才能正常不需要加端口访问,谢谢。
配置文件:
server {
listen 80;
server_name 10.0531.tw;
access_log /data/wwwlogs/10.0531.tw_nginx.log combined;
index index.html index.htm index.php;
root /data/wwwroot/10.0531.tw;
include /usr/local/nginx/conf/rewrite/none.conf;
#error_page 404 /404.html;
#error_page 502 /502.html;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_buffering off;
proxy_cache off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $proxy_host;
}
location ~ [^/].php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 30d;
access_log off;
}
location ~ .*.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /.ht 美国服务器{
deny all;
}
}