Last active
November 30, 2023 10:14
-
-
Save bastianallgeier/c2e1f1e519f5f2943ec4 to your computer and use it in GitHub Desktop.
nginx setup
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
# block content | |
location ~ ^/content/(.*).(txt|md|mdown)$ { | |
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect; | |
} | |
# block all files in the site folder from being accessed directly | |
location ~ ^/site/(.*)$ { | |
rewrite ^/site/(.*)$ /error redirect; | |
} | |
# block all files in the kirby folder | |
location ~ ^/kirby/(.*)$ { | |
rewrite ^/kirby/(.*)$ /error redirect; | |
} | |
# site links | |
location / { | |
try_files $uri $uri/ /index.php?$uri&$args; | |
} | |
# panel links | |
location /panel { | |
try_files $uri $uri/ /panel/index.php?$uri&$args; | |
} | |
# deny access to .htaccess files | |
location ~ /\.ht { | |
deny all; | |
} |
@wottpal can you share what you did for a sub-directory configuration. I couldn't get panel to work on nginx running on AWS
Is there a nginx config for kirby 3?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@JimmyRittenborg Are you able to share your full .conf file including the above code? I'm new to nginx and struggling to see how this comes together with things like error pages and fastcgi. Many thanks in advance.