直接上代码,code-server自行安装就行

server {
    listen [::]:80;
    listen 80;
    #listen [::]:443 ssl;
    #listen 443 ssl;
    #ssl on;
    
    server_name www.domain.com;
    #ssl_certificate /home/ssl/hvm.crt;
    #ssl_certificate_key /home/ssl/hvm.key;

    #ssl_session_timeout 5m;
    #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    #ssl_prefer_server_ciphers on;    
        
    root /home/www;
    index index.html;
    location / {
        proxy_pass http://127.0.0.1:8080/;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
        proxy_set_header Accept-Encoding gzip;
    }
}