Home >Backend Development >PHP Tutorial >Nginx port mapping configuration

Nginx port mapping configuration

不言
不言Original
2018-07-07 16:07:172305browse

This article mainly introduces the Nginx port mapping configuration, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

Nginx port mapping configuration

before Because

The traditional way to build a website is to use a web server to parse the file entry file, such as using Nginx and Apache to parse the corresponding entry file. However, with the development of technology, some languages ​​​​can build their own web Services, such as Node, PHP, use a development language to start a web service that can only be accessed locally by default, such as http://localhost:8000/ http://127.0.0.1:8000/

But in the development and debugging environment in Centos, the test is using a window browser, so an intermediate web server must be used for port mapping

Nginx Port mapping configuration

server {
    listen       80;
    server_name  rbac.dev-lu.com;

    # 80转发到8000端口
    location / {
            proxy_pass http://127.0.0.1:8000;
    }
}

The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

Nginx deploy static page

Nginx SSL fast two-way authentication configuration (script

The above is the detailed content of Nginx port mapping configuration. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn