< 返回版块

tarvos21 发表于 2019-11-07 01:27

Tags:Sapper,Nginx,Web,Server

在服务器上,需要用nginx作一次中转吗?速度怎样?怎样配置比较好?

谢谢!

评论区

写评论
作者 tarvos21 2019-11-08 12:23

感谢!🙏

对以下内容的回复:

Mike Tang 2019-11-07 09:56
server {
        server_name  test.cc;

        location /js/ {
                root /var/www/forustm2_static;
                expires 30d;
        }
        location /css/ {
                root /var/www/forustm2_static;
                expires 30d;
        }
        location /img/ {
                root /var/www/forustm2_static;
                expires 30d;
        }
        location /favicon.ico {
                root /var/www/forustm2_static;
                expires 30d;
        }

        location / {
                proxy_pass http://0.0.0.0:8081;
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}
Mike Tang 2019-11-07 06:08

对的,对的。稍后我给你发一下配置。

1 共 3 条评论, 1 页