Home  >  Q&A  >  body text

Router - Ask about nginx+apache configuration

Newbie help: I ​​want to build a typical nginx + reverse proxy apache server
The current configuration is as follows. The server is located on the intranet. nginx listens on port 80 and apache listens on port 81. The router has done nginx port mapping 8080->80 and has not done apache port mapping
I would like to know:
1. How to complete the reverse proxy configuration like most websites
2. If the router only does nginx port mapping (8080 to 80), can reverse proxy be implemented? Or do I need to do port mapping for apache?
3. Can this configuration mode support .htaccess?

黄舟黄舟2713 days ago491

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-16 17:06:01

    1.

    Apache2:

    Listen 127.0.0.1:81
    

    Nginx:

    server {
        listen 80;
        location / {
            proxy_pass http://127.0.0.1:81;
        }
    }
    

    2.

    Routing port mapping is only related to Nginx.

    3.

    Supported, usually just rewrite it in Apache2.
    Or you can use Nginx to process some static file requests in advance without forwarding them to Apache2.

    reply
    0
  • Cancelreply