-
Notifications
You must be signed in to change notification settings - Fork 426
Using a hostname rather than a URL in 'proxies' results in "[emerg] invalid number of arguments in "set" directive" #189
Comments
This was in the staging environment btw - seems to work as expected in production. |
@Hc747 Hi! Thank you for opening this issue. On Heroku-20 this buildpack uses a newer version of nginx + ngx_mruby, so there's a possible incompatibility that I'd like to track down. Could you paste in a code block your Also, are there any differences in the environment variables set on the staging vs prod apps that might explain why the latter works? Many thanks :-) |
Also if you could
...and then add the file to a gist and link from here - that would be very helpful :-) |
Hey @edmorley, thanks for getting back to me! No difference in environment variables. {
"root": "build",
"encoding": "UTF-8",
"https_only": false,
"clean_urls": true,
"routes": {
"/static/**": "/static/",
"/**": "index.html"
},
"proxies": {
"/api/": {
"origin": "www.example.com"
}
}
} Current configuration (which works in production but failed in staging): {
"root": "build",
"encoding": "UTF-8",
"https_only": true,
"clean_urls": true,
"routes": {
"/static/**": "/static/",
"/**": "index.html"
}
} |
Will try and replicate the staging issue; managed to reconfigure in production and get it up and running! :) |
@Hc747 Thank you for those. Looking at the generated nginx config, line 94 corresponds to: This is generated here:
Using the values set here: heroku-buildpack-static/scripts/config/lib/nginx_config.rb Lines 34 to 49 in 8bea3b3
This would suggest that staging still has |
Can confirm that |
Ah ok. I'd interpreted this to mean the second config (without proxy) was working in production but not staging:
...but it sounds now like the issue is not staging vs production, but using proxies vs not? In which case the reason this error is occurring, is that the Repro on Heroku-18:
The buildpack really should handle this case more gracefully (either by supporting URLs missing a scheme, or giving an explicit error message) and the docs could probably make this clearer (though the example uses a full URL) - though this limitation has been present for some time, so not a regression from #182. |
Great catch. Sorry for the misrepresentation of the issue. Really appreciate you digging into it! |
You're welcome! Thank you for providing the extra information needed to get to the bottom of this. I'm relieved it's something that doesn't need to be fixed before we can roll out the new nginx to all stacks (and also doesn't block usage of Heroku-20 in the meantime) :-) |
I've adjusted the title and will leave this open for improving the UX here if such a config is used. |
Hi This buildpack is now deprecated and we are recommending people move the more actively maintained heroku-buildpack-nginx. For migration advice see here. As such, I'm closing this issue out since we won't be making further changes to this buildpack. |
NGINX is unable to start on heroku-20 with the following buildpack configurations.
Receiving the following log output.
2020-12-03T02:57:13.000000+00:00 app[api]: Build succeeded
2020-12-03T02:57:14.467859+00:00 app[web.1]: Starting log redirection...
2020-12-03T02:57:14.468156+00:00 app[web.1]: Starting nginx...
2020-12-03T02:57:14.757957+00:00 app[web.1]: nginx: [emerg] invalid number of arguments in "set" directive in ./config/nginx.conf:94
2020-12-03T02:57:14.759577+00:00 app[web.1]: Process exited unexpectedly: nginx
2020-12-03T02:57:14.759757+00:00 app[web.1]: Going down, terminating child processes...
2020-12-03T02:57:14.815580+00:00 heroku[web.1]: Process exited with status 1
2020-12-03T02:57:14.853246+00:00 heroku[web.1]: State changed from starting to crashed
Happy to provide more context or specific details if it'll assist in resolving this issue. Haven't experienced this issue on heroku-18.
The text was updated successfully, but these errors were encountered: