Skip to content

Instantly share code, notes, and snippets.

@nevercodealone
Created January 16, 2021 10:21
Show Gist options
  • Save nevercodealone/264dfda7ce6212db74b3d65f91a766e5 to your computer and use it in GitHub Desktop.
Save nevercodealone/264dfda7ce6212db74b3d65f91a766e5 to your computer and use it in GitHub Desktop.
Nginx DDEV config for Sulu CMS
# ddev nginx-site.conf for Sulu CMS
# Set https to 'on' if x-forwarded-proto is https
map $http_x_forwarded_proto $fcgi_https {
default off;
https on;
}
server {
listen 80;
listen [::]:80 default ipv6only=on;
listen 443 ssl;
listen [::]:443 default ipv6only=on;
root /var/www/html/public;
ssl_certificate /etc/ssl/certs/master.crt;
ssl_certificate_key /etc/ssl/certs/master.key;
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}
# expire
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff|woff2|eot|ttf)$ {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
access_log off;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
# pass the PHP scripts to FastCGI server listening on socket
location ~ ^/(index|config)\.php(/|$) {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_intercept_errors off;
# fastcgi_read_timeout should match max_execution_time in php.ini
fastcgi_read_timeout 10m;
fastcgi_param SERVER_NAME $host;
fastcgi_param HTTPS $fcgi_https;
}
include /etc/nginx/monitoring.conf;
include /mnt/ddev_config/nginx/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment