Nginx Non-80-port configuration Nginx 80-Port forward Nginx without 80-port Nginx 80-port is accounted for

Source: Internet
Author: User

If the Nginx listener port is not the default 80 port and is changed to another non-80 port, the Request.getserverport () method in back-end service Tomcat does not get the correct port number and still returns to port 80. At Response.sendredirect (), the client may not get the correct redirect URL.

So the correct configuration:

?

1

2

3

4

5

6

7

8

9

10

server {

listen 8080;

server_name localhost;

location / {

proxy_pass http://192.168.1.100:8081;

proxy_set_header Host $host:8080;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

The above describes the Nginx non-80 port configuration, including the contents of the nginx,80 port, I hope that the PHP tutorial interested in a friend helpful.

  • 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.