标签:图片 html conf com auto 127.0.0.1 png ngnix har
1. 进入ngnix安装路径下,修改nginx.conf文件
cd /usr/local/nginx/

2. 增加www.water.com.conf文件
[root@*** conf]# cd vhost/
[root@*** vhost]# vi www.water.com.conf
文件内容:
server{
listen 80;
autoindex on;
server_name 10.18.7.55;
access_log /usr/local/nginx/logs/assess.log combined;
index index.html index.htm index.jsp index.php;
# if( $query_string ~* ".*[\;‘\<\>].*" ){
# return 404;
# }
location / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin *;
}
}
然后访问10.18.7.55,最终访问到http://127.0.0.1:8080
server_name 可以配置成域名
标签:图片 html conf com auto 127.0.0.1 png ngnix har
原文地址:https://www.cnblogs.com/linlf03/p/9061548.html