Step 1: Install Web Server and PHP

sudo apt install nginx php7.0-fpm php7.0-curl php7.0-mbstring php7.0-xml php7.0-zip

 

Step 2: Download Glype

wget https://www.php-proxy.com/download/glype-1.4.15.zip

 

Extract it to /var/www/proxy/ directory.

sudo apt install unzip

sudo mkdir -p /var/www/proxy/

sudo unzip glype-1.4.15.zip -d /var/www/proxy/

Set www-data (web server user) as the the owner.

sudo chown www-data:www-data /var/www/proxy/ -R

 

Step 3: Configure Web Server

 

In this step, we need to create a Nginx server block or Apache virtual host for our web proxy.

Create Nginx Server Block

Create a server block under /etc/nginx/conf.d/ directory.

sudo nano /etc/nginx/conf.d/web-proxy.conf

Copy and paste the following lines into the file. Replace proxy.example.com with your real domain name. Don’t forget to set A record in your DNS manager.

server {
        listen 80;
        server_name proxy.example.com;

        root /var/www/proxy/;
        index index.php;

        location / {
          try_files $uri $uri/ /index.php;
        }

         location ~ \.php$ {
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                include snippets/fastcgi-php.conf;
        }
}

Save and close the file. Then test Nginx configurations.

sudo nginx -t

If the test is successful, reload Nginx for the changes to take effect.

sudo systemctl reload nginx

 

 

Ads

 

 

Now let’s enable HTTPS with Let’s Encrypt.

Step 4: Enable HTTPS with Let’s Encrypt for Your Web Proxy

We can install Let’s Encrypt client (certbot) from the official PPA by executing the following commands.

sudo apt install software-properties-common

sudo add-apt-repository ppa:certbot/certbot

sudo apt update

sudo apt install certbot

Nginx users also need to install the Certbot Nginx plugin.

sudo apt install python-certbot-nginx

Enable HTTPS with the Nginx plugin.

sudo certbot --nginx --agree-tos --redirect --staple-ocsp -d proxy.example.com --email your-email-address

 

 

 

 

 

 

Ads

 

 

Watch the Video

https://youtu.be/23zUs1KFH5E

 

 

Share

Leave a Reply