安装Nginx过程问题
来源:2-17 nginx反向代理服务器域名解析配置实操(linux系统同学看这节)
慕粉3804594
2017-04-24
老师你好:我在linux安装配置好Nginx没有问题,但是建立vhost文件,创建自定义域名www.happy.com的www.happy.com.conf的配置文件时,无法跳转到tomcat的http://127.0.0.1:8080端口
8回答
-
Geely
2017-04-26
hi 同学,搞定了么,我看了你的配置,没有问题,请检查vhost所建的目录是否正确,
另外可否把具体的目录位置和里面的文件名目录也发上来,统一给你检查一下哈~~目前我看你的配置没毛病。
另外就是可以参考咱们线上的配置哟
http://learning.happymmall.com/nginx/
右键另存为下载下来,然后文本打开是格式化好的,对比着看一下呢?
012017-05-24 -
Geely
2017-04-24
但是那个配置是windows环境的,linux环境的请把对应的各种配置文件放上来哈,好好给你看一下
012017-04-24 -
Geely
2017-04-24
00 -
Geely
2017-04-24
hi同学,请放上详细的配置
00 -
饮茶仙人
2017-05-04
我也是同样的问题,同学你解决了吗
022017-05-07 -
丁政
2017-04-30
我也遇到了同样的问题!
012017-04-30 -
慕粉3804594
提问者
2017-04-24
//sudo vim /etc/hosts文件配置
#centos
192.168.254.128 www.happy.com
192.168.254.128 image.happy.com
192.168.254.128 s.happy.com
022017-08-03 -
慕粉3804594
提问者
2017-04-24
//这个www.happy.com.conf 配置文件
server{
listen 80;
autoindex on;
server_name www.happy.com;
access_log /usr/local/nginx/logs/access.log combined;
index index.hetml index.htm index.jsp index.php;
#error_page 404 /404.html;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location / {
proxy_pass http://127.0.0.1:8080;
add_header Access-Control-Allow-Origin '*';
}
}
//这个是nginx.conf文件 中引入 vhost下的以*.conf结尾的文件部分,只是加入那个引入的地方:
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
include vhost/*.conf;
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
~
00
相似问题