https://github.com/dncrypter/reverse-proxy-server-setup
In this project, I have setup 2 apache web servers that are integrated with nginx reverse proxy server. Restrict user to see original IP and to prevent from external attacks.
https://github.com/dncrypter/reverse-proxy-server-setup
apache2 linux nginx-proxy server-configuration shell-script
Last synced: 9 months ago
JSON representation
In this project, I have setup 2 apache web servers that are integrated with nginx reverse proxy server. Restrict user to see original IP and to prevent from external attacks.
- Host: GitHub
- URL: https://github.com/dncrypter/reverse-proxy-server-setup
- Owner: DNcrypter
- Created: 2025-02-01T14:36:23.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T10:56:52.000Z (11 months ago)
- Last Synced: 2025-02-16T11:28:22.681Z (11 months ago)
- Topics: apache2, linux, nginx-proxy, server-configuration, shell-script
- Homepage:
- Size: 593 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## ðNginx Reverse proxy server setup
[](https://choosealicense.com/licenses/mit/)
[](https://www.linkedin.com/in/nikhil--chaudhari/)
[](https://medium.com/@nikhil-c)
## ðIntroduction
In this project, I have setup 2 apache web servers that are integrated with nginx reverse proxy server. Restrict user to see original IP and to prevent from external attacks.

## ð Nginx web server setup :
As Nginx is available in Ubuntuâs default repositories, it is possible to install it from these repositories using the **apt** packaging system:
### Step 1â-âInstalling Nginx
```
sudo apt update
sudo apt install nginx
```
### Step 2â-âAdjusting the Firewall
enable required profile by typing and also verify the changes:
```
sudo ufw allow 'Nginx HTTP'
sudo ufw status
```
The output will indicated which HTTP traffic is allowed:
### Step 3â-âChecking your Web Server
```
systemctl status nginx
http://your_server_ip:8080
```

Now you have successfully setup nginx server.
### Refer Nginx web server setup my medium post
[www.medium.com/how-to-setup-nginx-web-server](https://medium.com/@nikhil-c/how-to-setup-nginx-web-server-on-ubuntu-v20-39ec20c0dbc3)
## ð Apache Web server setup
As I have already setup 2 apache web servers required to link nginx reverse proxy with it in my medium blog :
[www.medium.com/how-to-install-the-apache-web-server](https://medium.com/@nikhil-c/how-to-install-the-apache-web-server-with-proxy-setup-on-ubuntu-v20-8a2cf4a0891f)
## ð Nginx Reverse proxy server Configuration
As we setup already setup 2 apache2 web server and 1 nginx server which act as reverse proxy after we configure it. So lets configure:
#### Check all three required service status :
```
systemctl status httpd.service
systemctl status nginx.service
systemctl status firewalld.service
```
#### check normal working :
* check apache server : http://my-ip:80/index.html
* check nginx server : http://my-ip:8080/


Yes, both are working.
#### edit config file :
/etc/nginx/nginx.conf
```
location / {
proxy_pass http://my-ip:8080/;
}
```
#### To Restrict public access of secret.html file
```
location /secret.html {
deny all;
return "403 Forbidden";
}
```
* Test the configuration for syntax errors.
* If the test is successful, reload Nginx to apply the changes:
```
sudo nginx -t
sudo systemctl reload nginx
```
* After setup whole configuration just start and stop the service to reload all changes :
```
systemctl stop nginx.service
systemctl start nginx.service
```
#### Final working check
* Browser nginx server : http://my-ip:8080/

* It reflects with apache server default page. It means, we successfully setup reverse proxy.
## ð Conclusion
At starting, we setup nginx server then apache server after that we configured reverse proxy setting and firewall setting to allow proxy traffic.