购买咨询
微信咨询
电话咨询
预约演示
跳转到内容

nginx 配置

token 认证方式

conf.d 目录下面新建 dwsurvey.conf,并配置如下内容

conf
server {
    listen 80;
    server_name _;
    root /www/sf/dist;
    index index.html;

    location / {
        index index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    location /api {
         # rewrite ^/api/(.*) /$1 break;
         proxy_pass http://localhost:8899;
    }

    location /file {
         # rewrite ^/api/(.*) /$1 break;
         proxy_pass http://localhost:8899;
    }

    error_page 404 /404.html;
         location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
         location = /50x.html {
    }
}

编辑 nginx.conf 的配置引用 include /etc/nginx/conf.d/dwsurvey.conf; 如下所示

include /etc/nginx/conf.d/*.conf;

效果如图

alt text

session 认证方式

conf.d 目录下面新建 dwsurvey.conf,并配置如下内容

conf
server {
    listen 80;
    server_name _;
    root /www/sf/dist;
    index index.html;

    location / {
        index index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    error_page 404 /404.html;
         location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
         location = /50x.html {
    }
}

编辑 nginx.conf 的配置引用 include /etc/nginx/conf.d/dwsurvey.conf; 如下所示

include /etc/nginx/conf.d/*.conf;

效果如图

alt text

调问-专业的开源问卷表单系统