whcoding whcoding
首页
归档
关于
GitHub (opens new window)
首页
归档
关于
GitHub (opens new window)
  • ngxin

    • nginx 常用配置
    • 给你的网站免费配置 https
    • 更改 nginx php-fpm 运行用户
    • Nginx 设置允许跨域
    • Nginx
    • ngxin
    whcoding
    2020-09-07
    目录

    Nginx 设置允许跨域

    # 在 nginx 配置中添加

    server {
        listen 80;
        server_name ....
        root ....;
        
        # Cross Domains
        add_header Access-Control-Allow-Origin "*";
        add_header Access-Control-Allow-Methods "OPTION, POST, GET";
        add_header Access-Control-Allow-Headers "*";
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    #Nginx
    上次更新: 2022/08/30, 23:31:20
    更改 nginx php-fpm 运行用户

    ← 更改 nginx php-fpm 运行用户

    Theme by Vdoing | Copyright © 2018-2023
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式