Trojan-GFW on Ubuntu 20.04 Server
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigTb4cP_iplgN3G0q3qMGA0VL3dJxvcEy65m4-rfc7nR_owOZRHY-mGKUUxOd_qy7ko3Z367ZSWNPjW6YdMD0JpwRDMAglYCN1Et3V8nvhor2JqeUw37oBbMgsOGKQODuOKXf1a7PAflA/s640/wall-trojan-tutor-github-io.png)
Trojan is popular in China because it's easier to configure than V2Ray. The diagram below explains how it works. (Source: https://trojan-tutor.github.io/2019/04/10/p41.html ) Traffic arrives at port 443 or port 80 . Port 443 is handled by Trojan. Good passwords goes to the Trojan server. Bad passwords go to Nginx on localhost port 80 . Port 80 is handled directly by Nginx. The server runs Ubuntu 20.04. A DNS record type A points from host.example.com to the server's IP address. Install and Configure Nginx apt install nginx -y Edit the configuration file: vi /etc/nginx/sites-available/default Change the contents to read as follows. Nginx listens on port 80 . Change host.example.com in the example below to your actual server name. server { listen 80 default_server; root /var/www/html; index index.html; server_name host.example.com; location / { try_files $uri $uri/ =404; } } Save the file. Restart Nginx with the n