Initial CORS proxy configuration.
This commit is contained in:
commit
f27aa15c20
2 changed files with 36 additions and 0 deletions
32
README.md
Normal file
32
README.md
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# CORS proxy
|
||||||
|
|
||||||
|
## NGINX configuration
|
||||||
|
|
||||||
|
```nginx configuration
|
||||||
|
server
|
||||||
|
{
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name corsproxy.website; # REPLACE THIS.
|
||||||
|
|
||||||
|
root /path/to/CorsProxy; # REPLACE THIS.
|
||||||
|
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
|
||||||
|
location /
|
||||||
|
{
|
||||||
|
try_files $uri /proxy.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$
|
||||||
|
{
|
||||||
|
try_files $uri $document_root$fastcgi_script_name =404;
|
||||||
|
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/corsproxy.error.log;
|
||||||
|
}
|
||||||
|
```
|
4
proxy.php
Normal file
4
proxy.php
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$url = ltrim($_SERVER["REQUEST_URI"], "/ \t");
|
||||||
|
echo file_get_contents($url);
|
Loading…
Add table
Reference in a new issue