nginx配置代理文件、反向代理配置
nginx配置代理文件、反向代理配置
server { listen 80; listen 443 ssl; # 域名 server_name asgcode.test.com; ssl on; ssl_certificate /home/test/aiphoto_data_maintain/run/ssl/server.crt; ssl_certificate_key /home/test/aiphoto_data_maintain/run/ssl/server.key; ssl_client_certificate /home/test/aiphoto_data_maintain/run/ssl/root.crt; ssl_verify_client on; ssl_session_timeout 5m; client_max_body_size 20m; # https #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; access_log /data/asgcode/logs/nginx/access.log main; error_log /data/asgcode/logs/nginx/error.log; #location /myfiles/ { # alias /home/test/test_file/; # autoindex on; # 自动列出目录下的文件; # autoindex_exact_size off; # 文件大小按 G、M 的格式显示,而不是 Bytes; # add_header Access-Control-Allow-Origin *; # add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"; # add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; #} #代理文件 location /static/save_image/ { alias /home/zhaoyingjie/aiphoto_data_maintain/static/save_image/; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"; add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; } # 显示文件 location /testdetect/ { alias /home/zhaoyingjie/aiphoto_data_maintain/static/detect/; index index.html; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"; add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; } # 反向代理 location / { add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "POST,GET,OPTIONS"; #add_header Access-Control-Allow-Headers x-requseted-with,content-type; add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $remote_addr; proxy_headers_hash_max_size 51200; proxy_headers_hash_bucket_size 6400; set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; include uwsgi_params; uwsgi_pass 127.0.0.1:7060; } }
分类:
Linux 服务器那些事
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
2020-10-15 Beego model 增删改查
2020-10-15 Beego 搭建
2020-10-15 Go 如何快速解决依赖管理问题
2016-10-15 js动态生成数据列表
2016-10-15 Echarts通过Ajax实现动态数据加载
2016-10-15 个人收藏的必备网页设计控件,也许正是你在寻找的