Skip to content
💡Github OAuth 中转解决跨域的 PHP 实现 参考来自: imsun/gh-oauth-server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
common
public
.gitignore
README.md
composer.json
composer.lock
run.php

README.md

Github OAuth Server

Github OAuth 解决跨域的 PHP 实现

安装

$ git clone https://github.com/isecret/gh-oauth-server.git
$ composer install

使用

Nginx 入口应为 /public 目录,以下仅供参考:

server
{
    listen 80;
    listen 443 ssl http2;
    server_name gh-oauth.openapi.link;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/gh-oauth.openapi.link/public;
    .
    .
    .
    location / {
        if ($request_method = OPTIONS ) {
            add_header Access-Control-Allow-Origin "*";
            add_header Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, DELETE";
            add_header Access-Control-Max-Age "3600";
            add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization, FOO";
            add_header Content-Length 0;
            add_header Content-Type text/plain;
            return 200;
        }
    }
    .
    .
    .
}
You can’t perform that action at this time.