应客户要求,需要给客户配个域名,然后我们的大牛强哥 建议后台不要配备域名服务器了,这样不安全,一般都是对外的web服务器才配置域名;
结合另外收藏的一个博文安装nginx,然后修改配置文件如下:
server {
listen 80; ——————————固定端口80
server_name A B; ——————逗号间隔一级域名、二级域名
location / {
root /alidata1/tomcat-tes/……;————————服务器绝对路径 根目录
index index.html index.htm index.jsp;
proxy_send_timeout 1200;
proxy_connect_timeout 1200;
proxy_pass http://121.41.*.216*;——————————要比对的地址
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
location /share {————————服务器业务模块二级路径
index index.html index.htm index.jsp;
proxy_send_timeout 1200;
proxy_connect_timeout 1200;
proxy_pass http://121.4*;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
location /chao {
index index.html index.htm index.jsp;
proxy_send_timeout 1200;
proxy_connect_timeout 1200;
proxy_pass http://121.41.4*/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
}
修改完了之后要重启nginx 命令, service nginx restart
安装说明重要提醒:程序不支持二级目录安装,请使用一级目录或二级目录绑定!第一步,确定你的服务器支持PHP+mysql。第二步,确定你的服务器开启了gd库。第三步,将upload文件内的文件上传到网站的根目录第四步,访问你的域名+ /install/index.html进行安装,linux系统访问你的域名+ /Install/index.html第五步,按照安装程序步骤进行安装配置第六步,安装完毕后
如果有必要还重启一下tomcat,
初识nginx
以上就介绍了nginx域名重定向遇到的问题,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。









