Last active
February 9, 2023 16:02
-
-
Save emeaguiar/aa8998e75094197f9a8197073ac936eb to your computer and use it in GitHub Desktop.
nginx conf
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
# Basic conf | |
server { | |
server_name _; | |
return 302 $scheme://mysite.test$request_uri; | |
} | |
# Custom conf | |
server { | |
server_name ~^(.*)\.mysite\.test$ mysite.test; | |
root /app/public/; | |
# If file ends with these extensions | |
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp|webp)$ { | |
try_files $uri @image_fallback; # Try this address (defined below) | |
} | |
# Define URL to try (prod url) | |
location @image_fallback { | |
proxy_pass https://mysite.com; | |
} | |
# More default conf... | |
index index.php index.html index.htm; | |
include do-not-modify/*.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment