From f27aa15c20f72929b050bd93343ef7388cdf3ea0 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Fri, 15 Nov 2024 17:07:21 +0100 Subject: [PATCH] Initial CORS proxy configuration. --- README.md | 32 ++++++++++++++++++++++++++++++++ proxy.php | 4 ++++ 2 files changed, 36 insertions(+) create mode 100644 README.md create mode 100644 proxy.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce5d42a --- /dev/null +++ b/README.md @@ -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; +} +``` diff --git a/proxy.php b/proxy.php new file mode 100644 index 0000000..e3b8d89 --- /dev/null +++ b/proxy.php @@ -0,0 +1,4 @@ +