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

Nginx port mapping configuration

不言
Release: 2023-04-02 20:22:02
Original
2287 people have browsed it

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;
    }
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template