• nginx配置,解决前端跨域调用问题



    #user nobody;
    worker_processes 1;

    #error_log logs/error.log;
    #error_log logs/error.log notice;
    #error_log logs/error.log info;

    #pid logs/nginx.pid;


    events {
    worker_connections 1024;
    }


    http {
    include mime.types;
    default_type application/octet-stream;

    #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    # '$status $body_bytes_sent "$http_referer" '
    # '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log logs/access.log main;

    sendfile on;
    #tcp_nopush on;

    #keepalive_timeout 0;
    keepalive_timeout 65;

    #gzip on;

    server {
    listen 8080; #端口号
    server_name localhost; #监听服务名称

    location / {
    root D:/yayingH5/yayingH5/unpackage/dist/build/h5; #前端页面地址
    index index.html index.htm;
    }

    location /wx/ {
    # ilead back-end address
    proxy_pass http://172.16.205.99:8080/wx/; #跨域调用路径
    }

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

    }

    }

  • 相关阅读:
    LDA的整体流程
    java中字符串的用法
    verification Code
    properties
    Hash
    substring的问题
    LDA和PLSA的区别
    Step By Step(Lua环境)
    Step By Step(Lua调用C函数)
    Step By Step(Lua弱引用table)
  • 原文地址:https://www.cnblogs.com/ZenoLiang/p/15787903.html
Copyright © 2020-2023  润新知