Skip to content

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

Notifications You must be signed in to change notification settings

isecret/gh-oauth-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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