Apache and nginx reverse proxy settings tutorial, apacheng.pdf
Apache
a2enmod proxya2enmod proxy_httpa2enmod proxy_connect
Edit/etc/apache2/mod-available/proxy. conf
Add this, or modify the proxy in the assistant.
Order allow,deny Allow from all
Set the site configuration file. Take the proxy's local port 3000 as an example. When we access XXXXX.giantbranch.cn, we can access the website with the local port 3000.
...... ServerName XXXXX.giantbranch.cn ProxyPass / http://127.0.0.1:3000/ ProxyPassReverse / http://127.0.0.1:3000/ ......
Restart (ubuntu is used as an example below)
service apache2 restart
Some systems can do this.
systemctl restart apache2
Nginx
This is much simpler. If you directly create a site configuration file, you can access haha.giantbranch.cn to access port 3001 locally.
server { ...... listen 80; server_name haha.giantbranch.cn; location / { proxy_pass http://localhost:3001; } ......}
Of course, restart it.
service nginx restart