Home >Backend Development >PHP Tutorial >Problems encountered with nginx domain name redirection
At the request of the customer, we need to assign a domain name to the customer. Then our Daniel Qiang suggested that the backend should not be equipped with a domain name server. This is not safe. Generally, the external web server configures the domain name;
Combined with another collected blog post Install Nginx, and then modify the configuration file as follows:
Seerver {
Listen 80; ———————————————————————————————————————————————————————————————————————————————— The fixed port 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*;——————————Address to compare
proxy_set_head proxy_set_header Host $ http_host;
location _timeout 1200;
proxy_pass http://121.4 *; 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
proxy_set_header
After modification, you need to restart the nginx command, service nginx restart
Restart tomcat if necessary,
First time getting to know nginx
The above introduces the problems encountered by nginx domain name redirection, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.