Created
August 17, 2021 20:56
-
-
Save Caffe1neAdd1ct/cf9f600bfe77d5a6edf4c4c495740fcb to your computer and use it in GitHub Desktop.
Apache Reverse Proxy to PHP InBuilt Webserver with SSL
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
<VirtualHost *:443> | |
ServerName app.host.local | |
ServerAdmin root@localhost | |
DocumentRoot "/srv/http/" | |
<Directory "/srv/http/"> | |
Options -Indexes -FollowSymLinks -MultiViews | |
AllowOverride All | |
Require all granted | |
</Directory> | |
ProxyPass "/" "http://localhost:8000/" | |
ProxyPassReverse "/" "http://localhost:8000" | |
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} | |
RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS} | |
# Enable SSL | |
SSLEngine On | |
SSLCertificateFile /etc/ssl/certs/tls/app.host.local.pem | |
SSLCertificateKeyFile /etc/ssl/certs/tls/app.host.local.key | |
SSLInsecureRenegotiation Off | |
SSLCompression Off | |
ErrorLog "/var/log/httpd/app.host.local/error.log" | |
CustomLog "/var/log/httpd/app.host.local/access.log" combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Forward headers allow laravel apps to work correctly when generating URLs, redirects and routes when running behind an SSL proxy with the local env running in plain http inbuilt websever
Using mkcert to provide local valid ssl certs copied into /etc/ssl/certs/tls/
Permissions
chown root:root
chmod 400 *.key
chmod 640 *.pem
mkdir /var/log/httpd/app.host.local