Skip to content

isecret/gh-oauth-server

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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;
        }
    }
    .
    .
    .
}

About

💡Github OAuth 中转解决跨域的 PHP 实现 参考来自: imsun/gh-oauth-server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages