Problems found during Nginx deployment

Source: Internet
Author: User
: This article describes the problems found during Nginx deployment. For more information about PHP tutorials, see. 1. during SSH project development, no action is configured when nginx configures the service. nginx does not forward the action request.

It turns out to be as follows:

# JSP is directly processed by tomcat, because nginx is not a servlet container and cannot process JSPlocation ~ . * \. (Jsp | do) $ {proxy_pass http: // mysvr; # The following are some reverse proxy configurations that can be deleted. proxy_redirect off; # backendWeb serverYou can obtain the Real IPproxy_set_header Host $ host: 9999; proxy_set_header X-Real-IP $ remote_addr through X-Forwarded-For $ proxy_add_x_forwarded_for ;}
To:
# JSP is directly processed by tomcat, because nginx is not a servlet container and cannot process JSPlocation ~ . * \. (Jsp | do | action) $ {proxy_pass http: // mysvr; # The following are some reverse proxy configurations that can be deleted. proxy_redirect off; # backendWeb serverYou can obtain the Real IPproxy_set_header Host $ host: 9999; proxy_set_header X-Real-IP $ remote_addr through X-Forwarded-For $ proxy_add_x_forwarded_for ;}

2. when nginx is modified not to listen on port 80 (default), for example, to Port 9999, the backend obtains port 80 or port 80, this is the port that nginx needs to add when setting the real IP address and port.

It turns out to be as follows:

# JSP is directly processed by tomcat, because nginx is not a servlet container and cannot process JSPlocation ~ . * \. (Jsp | do | action) $ {proxy_pass http: // mysvr; # The following are some reverse proxy configurations that can be deleted. proxy_redirect off; # backendWeb serverYou can obtain the Real IPproxy_set_header Host $ host through X-Forwarded-For; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for ;}
The modification is as follows:
# JSP is directly processed by tomcat, because nginx is not a servlet container and cannot process JSPlocation ~ . * \. (Jsp | do | action) $ {proxy_pass http: // mysvr; # The following are some reverse proxy configurations that can be deleted. proxy_redirect off; # backendWeb serverYou can obtain the Real IPproxy_set_header Host $ host: 9999; proxy_set_header X-Real-IP $ remote_addr through X-Forwarded-For $ proxy_add_x_forwarded_for ;}

The above describes the problems found during Nginx deployment, including Web server content, and hope to be helpful to friends who are interested in PHP tutorials.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.