gatsbyjs / gatsby-docker

Docker image that builds and hosts a Gatsby site
MIT License
357 stars 88 forks source link

allow overrides in nginx configuration #33

Open gunzip opened 4 years ago

gunzip commented 4 years ago

as the configuration file is set now, it is impossible to http add headers because the hardcoded location directives precede the customization part. I propose to put the custom environment variable $CUSTOM_SERVER_CONFIG before the location sections.

gatsbot[bot] commented 4 years ago

@gunzip We noticed that the body of this issue is blank.

Please fill in this field with more information to help the maintainers resolve your issue.

Generated by :no_entry_sign: dangerJS

torenware commented 4 years ago

Could you give an example of an override you'd want to do, and where in the resulting nginx config file it would need to be? You can see the file that gets generated by running:

docker run -rm IMAGE_NAME cat /etc/nginx/mushed.conf

One serious limitation here is that nginx won't let you duplicate a setting in a block; it will quit with an error rather than start. So overrides may not be possible doing what we're doing nginx-boot.sh script that we're using to handle the customizations. But if I know what you're trying to do, we can figure out if this is the way to do it.