1 Answer
- Newest
- Most votes
- Most comments
0
Hey there,
Craft CMS developer here! I've been working towards transitioning to AL2 and ran into this problem as well. The trick I used was to store the nginx partials in the conf.d folder.
In fact, I went ahead and structured my setup akin to Laravel Forge. So my folder structure looks like this:
.platform/
- after/
- before/
- partials/
- - compression.conf
- - expires.conf
- - security.conf
- sites-enabled
- - default.conf
- nginx.conf
My nginx.conf ends up looking like this:
#Elastic Beanstalk Nginx Configuration File
user nginx;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 66485;
events {
worker_connections 1024;
}
http {
map $http_upgrade $connection_upgrade {
default "upgrade";
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include conf.d/*.conf;
include conf.d/before/*;
include conf.d/sites-enabled/*;
include conf.d/after/*;
}
and my default.conf is fairly standard, but with:
# System level server mods
include conf.d/server/*;
# Load configuration files from nginx-partials
include conf.d/partials/*.conf;
Feel free to hit me up on the Craft CMS discord (@Ransom) if you need anymore help.
answered 4 years ago
Relevant content
- Accepted Answerasked 2 months ago
- asked 6 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago