Nginx port mapping configuration

V Records 4,567 Views , No comment

Foreword

The common way to build a website is to use a web server to parse the file entry file. For example, using Nginx, Apache parses the corresponding entry file, but with the development of technology, some languages can also be used as a web service alone, such as Node, PHP. Starting a web service using the development language can only be accessed locally by default, such as http://localhost:8000/ http://127.0.0.1:8000/

But in the Centos (or other Linux environment) configuration development debugging environment for testing is to use the window browser, so you need to use an intermediate web server for port mapping

Nginx port mapping configuration

Nginx reverse proxy – multiport mapping

Description

1.1 http://test.nginxer.com The default port is 80, using the reverse proxy access “/” to access another local port 8081;
1.2 8081 port represents the local front-end project access address, the front-end also needs to access the background data, “/background” continue to proxy to the background address port 8091;
1.3 This is done by opening port 80 and completing multiple port accesses;
1.4 The root configuration can be either an absolute path or a relative path.

ps. You can also use http://127.0.0.1 instead of http://localhost


This article was first published by V on 2018-10-07 and can be reprinted with permission, but please be sure to indicate the original link address of the article :http://www.nginxer.com/records/nginx-port-mapping-configuration/

Leave a Reply

Your email address will not be published. Required fields are marked *

Go