New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NGINX - admin forbidden #263
Comments
Hello @wsokc, currently I haven't done so many attempts to use Formwork with nginx, I'm not used to its config syntax too. |
I agree with this, I use only nginx as it is much easier than another web/proxy server, all in one bottle! |
haven't invented the configuration for nginx yet? |
Hi @wsokc and @TOWUK, server {
index index.html index.php;
# Adjust port and server name to your needs
listen 8088;
server_name localhost;
# Adjust web root to your needs
root /usr/local/var/www;
charset utf-8;
# Disable access to directory indexes
autoindex off;
location /site/templates/assets/ {
}
location ~ "^/admin/(assets|avatars)/.*" {
}
location / {
# Prevent direct access to Formwork folders but allow access to assets
rewrite ^/(admin|backup|cache|formwork|site|vendor)/.* /index.php last;
# Prevent access to specific files
rewrite ^/(.*)\.(md|yml|json)/?$ /index.php last;
rewrite ^/(\.(.*)|LICENSE|composer\.lock)/?$ /index.php last;
# Let all URI be processed by index.php
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
# Adjust PHP-FPM port to your needs
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
} |
Hi,
When I try to install, the admin folder was forbidden,
I'm using nginx, any ideas how to solve this ?
The text was updated successfully, but these errors were encountered: