-
-
Save beroso/18d95444b12ce21227735bdb5463cbd1 to your computer and use it in GitHub Desktop.
Apache reverse proxy `.htaccess` file eg. for NodeJS. @Uberspace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SetEnvIf Request_URI "^(.*)" PORT=65300 | |
| RewriteEngine On | |
| RewriteBase / | |
| # CORS | |
| Header add Access-Control-Allow-Origin "*" | |
| # HTTPS | |
| RewriteCond %{HTTPS} !=on | |
| RewriteCond %{ENV:HTTPS} !=on | |
| RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| # PORT | |
| RewriteCond %{SERVER_PORT} !^%{ENV:PORT}$ | |
| RewriteRule ^(.*) https://%{HTTP_HOST}:%{ENV:PORT}%{REQUEST_URI} [L,R=301] | |
| # RPROXY | |
| # RewriteRule ^(.*) http://localhost:${ENV:PORT}/$1 [P] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment