美文网首页
nginx 配置

nginx 配置

作者: 没感情的不要唱情歌 | 来源:发表于2020-01-04 11:58 被阅读0次

nginx 配置问题

server {

    listen        80; # nginx 端口号

    server_name    localhost ;

    charset UTF-8;

    access_log      /var/log/nginx/jc_shop_access_log.log;

    error_log      /var/log/nginx/jc_shop_error_log.log;

    client_max_body_size 75M;

# vue 配置

    location / {

        root /home/project/jc_tokiea/dist;

        index index.html;

        try_files $uri $uri/ /index.html;

    }

    location /api/ {

        include uwsgi_params;

        rewrite ^/api/(.*) /$1 break;

        #proxy_pass http://127.0.0.1:8000/;

        uwsgi_pass  127.0.0.1:8000;

      # django运行端口 和项目中的wsgi交互socket

        uwsgi_read_timeout 300;

        uwsgi_send_timeout 300;

        uwsgi_connect_timeout 300;

    }

    location /static {

        # 静态文件配置

        alias /home/project/jc_tokiea/dist/static;

}

    #location /media {

        # 静态文件配置

        #alias /home/project/jc/media/;

    #}

}

相关文章

网友评论

      本文标题:nginx 配置

      本文链接:https://www.haomeiwen.com/subject/uxxuqftx.html