railwayapp / nixpacks

App source + Nix packages + Docker = Image
https://nixpacks.com
MIT License
2.47k stars 232 forks source link

Nginx config template throws error on deployment #968

Closed jakobpack closed 11 months ago

jakobpack commented 11 months ago

Is there an existing issue for this?

Describe the bug

When using the template config file (src/providers/php/nginx.template.conf) in my project as nginx.conf, I get the error:

nginx: [emerg] directive "include" is not terminated by ";" in /app/nginx.conf:11

when deploying my app.

Is this a problem with my Railway configuration?

To reproduce

  1. Copy file contents of src/providers/php/nginx.template.conf
  2. Create new file nginx.conf on project root directory with copied content
  3. Deploy to Railway

Expected behavior

No response

Environment

Nixpack ?.? (don't know how to find out)

brody192 commented 11 months ago

You used the nginx.template.conf file so the file name you use in your project should also be nginx.template.conf This is not an issue with nixpacks, and if you'd like more help please open a #Help thread in the Railway discord server

jakobpack commented 11 months ago

In the documentation it states that nginx.config is accepted. But renaming the file to nginx.template.conf fixed the issue.

brody192 commented 11 months ago

correct both files are accepted, but they are differences between them, for example the template file is passed through perl to replace the PORT variable with railways auto generated PORT

jakobpack commented 11 months ago

Gotcha, thank you for your help.