Home  >  Article  >  Operation and Maintenance  >  How to set up multi-port access for nginx

How to set up multi-port access for nginx

藏色散人
藏色散人Original
2019-08-27 10:42:275261browse

How to set up multi-port access for nginx

How to set up multi-port access on nginx?

First find the path to default.conf corresponding to nginx, and then use the remote tool, I use wincp, to open the corresponding path, copy a conf path, and rename it.

How to set up multi-port access for nginx

Configure the external and internal ports: Then open port 8082 on the firewall, restart the firewall, close nginx, and start nginx. There are specific instructions in the cited article. Order. At this time, it may not be finished, and ngnix may not be started.

How to set up multi-port access for nginx

At this time, you need to re-execute the command in the article: yum install policycoreutils-pythonsudo cat /var/log/ audit/audit.log | grep nginx | ​​grep denied | audit2allow -M mynginxsudo semodule -i mynginx.pp.

How to set up multi-port access for nginx

Modify the main configuration file: Just change one place: Add the virtual host configuration file directory you want to reference in the http module: Under /etc/nginx/ Create a vhosts folder specifically to place the website's configuration files.

How to set up multi-port access for nginx

#After the virtual machine configuration file is configured, you need to add the above domain name under the hosts file under Linux, otherwise you will still access the external network.

How to set up multi-port access for nginx

If we want to access the website under Linux in the virtual machine under Windows, we must also configure the hosts file under Windows, and all domain names point to the Linux server.

How to set up multi-port access for nginx

For more Nginx related technical articles, please visit the Nginx Usage Tutorial column to learn!

The above is the detailed content of How to set up multi-port access for nginx. 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