Created
July 18, 2017 18:18
-
-
Save xolubi/8651d48e332c8d14e2b5b63e7c94cac9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/tmp/nginx.conf": | |
content: | | |
# Elastic Beanstalk Managed | |
# Elastic Beanstalk managed configuration file | |
# Some configuration of nginx can be by placing files in /etc/nginx/conf.d | |
# using Configuration Files. | |
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/customize-containers.html | |
# | |
# Modifications of nginx.conf can be performed using container_commands to modify the staged version | |
# located in /tmp/deployment/config/etc#nginx#nginx.conf | |
# Elastic_Beanstalk | |
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
############################### | |
# CUSTOM CONFIG TO IGNORE 4xx # | |
############################### | |
map $status $loggable { | |
~^[4] 0; | |
default 1; | |
} | |
map $status $modstatus { | |
~^[4] 200; | |
default $status; | |
} | |
##################### | |
# END CUSTOM CONFIG # | |
##################### | |
port_in_redirect off; | |
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"'; | |
access_log /var/log/nginx/access.log main; | |
sendfile on; | |
keepalive_timeout 65; | |
# Elastic Beanstalk Modification(EB_INCLUDE) | |
log_format healthd '$msec"$uri"' | |
'$status"$request_time"$upstream_response_time"' | |
'$http_x_forwarded_for'; | |
include /etc/nginx/conf.d/*.conf; | |
# End Modification | |
} | |
container_commands: | |
01_modify_nginx: | |
command: cp /tmp/nginx.conf /tmp/deployment/config/#etc#nginx#nginx.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment