• walle2.0 nginx.conf配置文件参数


    vim /usr/local/nginx/conf
    #user nobody;
    worker_processes 1;
    
    events {
    worker_connections 1024;
    }
    http{
    include vhost/*.conf;
    }
    
     
    
    
    vim /usr/local/nginx/conf/vhost/walle.conf
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    upstream webservers {
    server 0.0.0.0:5000 weight=1; # 负载设置
    }
    
    server {
    listen 80;
    ## server_name localhost; # 域名设置
    access_log /data/wwwlogs/walle.log combined;
    index index.html index.htm; # 日志目录
    
    location / {
    try_files $uri $uri/ /index.html;
    add_header access-control-allow-origin *;
    root /data/wwwroot/walle-web/fe; # 前端代码已集成到walle-web,即walle-web/fe的绝对路径
    }
    
    location ^~ /api/ {
    add_header access-control-allow-origin *;
    proxy_pass http://127.0.0.1:5000;
    proxy_set_header X-Forwarded-Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Origin $host:$server_port;
    proxy_set_header Referer $host:$server_port;
    }
    
    location ^~ /socket.io/ {
    add_header access-control-allow-origin *;
    proxy_pass http://127.0.0.1:5000;
    proxy_set_header X-Forwarded-Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Origin $host:$server_port;
    proxy_set_header Referer $host:$server_port;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    
    # WebScoket Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }
    }
  • 相关阅读:
    使用django开发一个web项目初试
    关于github一些比较重要的命令
    删除github repository的方法
    Node、npm与Vue配置与问题记录
    [记忆]5月第二周
    git am patch冲突解决步骤
    git丢弃本地修改的几种方式
    Log4j 2.X 漏洞解决
    Maven依赖范围Scope及传递性依赖
    Mysql创建事件定时任务
  • 原文地址:https://www.cnblogs.com/caidingyu/p/10488171.html
Copyright © 2020-2023  润新知