Last active
October 7, 2024 10:34
-
-
Save perguth/db00315d4ec7616ffd75a355e4abddfb to your computer and use it in GitHub Desktop.
Apache reverse proxy `.htaccess` file eg. for NodeJS. @Uberspace
This file contains 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