首页 > 系统相关 >nginx配置(图片跨域问题)

nginx配置(图片跨域问题)

时间:2023-12-06 15:03:40浏览次数:37  
标签:set http 跨域 header nginx api proxy remote 图片


events {
    worker_connections 1024;
}
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

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

    # 转发websocket需要的设置
    proxy_set_header X-Real_IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';

    # Service1服务配置
    server {
        listen       8844;
        server_name  192.168.110.72;


		location / {
            root  html/api;
                  index  index.html;
        }
        location /api/ {
            proxy_pass http://localhost:8090/api/;
        }
    }
}


标签:set,http,跨域,header,nginx,api,proxy,remote,图片
From: https://blog.51cto.com/u_15199927/8704987

相关文章

  • Nginx篇之路由匹配规则以及配置url转发
      alias与root的区别root  实际访问文件路径会拼接URL中的路径alias  实际访问文件路径不会拼接URL中的路径示例如下:location^~/sta/{alias/usr/local/nginx/html/static/;}请求:http://test.com/sta/sta1.html实际访问:/usr/local/nginx/html/......
  • nginx中目录浏览配置
    root方式配置:(会自动加目录名)#开放本地目录-rootserver{listen81;server_namelocalhost127.0.0.10.0.0.0;charsetutf-8;#处理中文乱码location/test{autoindexon;#开启目录浏览autoindex_exact_siz......
  • asp.net如何生成图片验证码
    新建一个页面image.aspx,添加命名空间:usingSystem.Drawing.Imaging;usingSystem.IO;然后在Page_load事件拷入如下代码: stringtmp=RndNum(4); HttpCookiea=newHttpCookie("ImageV",tmp);  Response.Cookies.Add(a); this.ValidateCode(tmp);接下来向该页面......
  • Nginx相关
    Nginx常见问题总结1、解决跨域问题:前端代码设置base_api VUE_APP_BASE_API='/api'网站访问域名nginx配置server{listen443http2ssl;listen[::]:443http2ssl;server_namemgmt-web.sxyd.cc;ssl_protocolsTLSv1TLSv1.1TLSv1.2;ssl......
  • word同一行带题注的两张图片生成的图表目录在同一行的解决办法
    本文转载自:https://blog.csdn.net/Liangontheway/article/details/120316467每张图片通过题注来编号的,同一行的两张图片生成图目录就会在同一行,这也太不美观了。解决办法一:将图片放到表格里,然后隐藏表格边框就好了再次生成目录问题解决了!!!解决办法二是插入图文框,这个操作起......
  • 【Nginx40】Nginx学习:动静分离与日志分割
    Nginx学习:动静分离与日志分割放轻松放轻松,最后两篇文章学习的内容是比较轻松的。首先,我们来看看Nginx动静分离的概念,然后再看看怎么为Nginx做日志分割。内容都很简单,完全不需要有任何的压力。动静分离动静分离,听着高大上吧,而且也是面试中比较喜欢问的问题。简单来说,就是动态请......
  • 【Nginx39】Nginx学习:upstream服务器组模块
    Nginx学习:upstream服务器组模块最后一个重点模块内容啦,感谢坚持到现在的你和我。总算是向大佬的道路上又前进了一步了。今天的内容主要是服务器组的配置,其实更直白点,就是Nginx负载均衡的配置模块。会不会有小伙伴不明白负载均衡是啥?如果是新同学,还不明白的话,要自己查查资料补习一......
  • 【VUE】vue动态变换背景图片的实现 +背景图片铺满+ 一般路由的配置
    一、动态变换背景图片的实现代码如下:<template><divclass="body"v-loading="loading":style="{backgroundImage:'url('+bgi+')'}"></div></template><script>data(){reyurn{ b......
  • mac安装nginx
     ~%brewinstallnginx==>Downloadinghttps://formulae.brew.sh/api/formula.jws.json#=#=-###=O#-##-#O=-########################################################################################################################......
  • 使用ThinkPHP框架根据Excel内容批量处理图片名称详解记录
    ThinkPHP依赖以下环境Nginx+PHP,建议提前装好Composer,PHP、Composer需要设置好系统环境变量。1.通过Composer安装Laravel框架composercreate-projecttopthink/thinkthinkphp6启动服务测试cdthinkphp6phpthinkrun然后就可以在浏览器中访问http://localhost:8000如果不能显示......