Skip to content

Instantly share code, notes, and snippets.

@achraf-jeday
Last active December 3, 2021 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achraf-jeday/a28313c309ccfa2ae8b8995c68616330 to your computer and use it in GitHub Desktop.
Save achraf-jeday/a28313c309ccfa2ae8b8995c68616330 to your computer and use it in GitHub Desktop.
Nginx configuration for Drupal 9 without ssl (only http)
server {
listen 80;
listen [::]:80;
server_name dev.passwordlocker.loc;
index index.php index.html index.htm;
root /var/www/html/web;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass drupal:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off; access_log off;
}
location = /robots.txt {
log_not_found off; access_log off; allow all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment