override nginx.conf so we can use gzip

This commit is contained in:
keyan 2021-10-06 20:39:51 -07:00
parent 9ed7abde0e
commit 56ff9d913d
2 changed files with 41 additions and 1 deletions

View File

@ -1,5 +1,4 @@
listen 443 default_server; listen 443 default_server;
gzip on;
location / { location / {
set $redirect 0; set $redirect 0;
if ($server_port != 443) { if ($server_port != 443) {

View File

@ -0,0 +1,41 @@
#Elastic Beanstalk Nginx Configuration File
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65727;
events {
worker_connections 1024;
}
http {
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;
map $http_upgrade $connection_upgrade {
default "upgrade";
}
server {
listen 80 default_server;
access_log /var/log/nginx/access.log main;
client_header_timeout 60;
client_body_timeout 60;
keepalive_timeout 60;
gzip on;
gzip_comp_level 4;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Include the Elastic Beanstalk generated locations
include conf.d/elasticbeanstalk/*.conf;
}
}