Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

401 response when defining local ip in endpoint config #36

Open
nathanhornby opened this issue Jan 31, 2016 · 2 comments
Open

401 response when defining local ip in endpoint config #36

nathanhornby opened this issue Jan 31, 2016 · 2 comments

Comments

@nathanhornby
Copy link

I’m having trouble getting mailgun to play nice in production. When defining the local IP in the config as follows:

http: [ip: {127, 0, 0, 1}, port: {:system, "PORT"}],
url: [host: "redacteddomain.com", port: 443],

This causes mailgun to return a 401 error. Simply removing ip: {127, 0, 0, 1} resolves the issue.

I’ve got that in place to prevent direct outside access to the ip:port (as otherwise you can can access the app directly on an http connection which is what the phoenix app is using, SSL is handled by nginx).

Is this expected behaviour or issue-worthy?

@nathanhornby
Copy link
Author

Ah, I'd misidentified the issue it seems. Re-introducing the ip, but removing the port from the url seemed to resolve the issue. Is this something to do with how the package builds the request? I'm curious if I've done something wrong in my config or if the package just doesn't like it.

@xjlu
Copy link

xjlu commented Oct 4, 2016

I had exactly the same issue on production. It worked in development mode, but got 401 on heroku.

Solution: I simply switched to use Bamboo. It has a mailgun adapter since 0.5 (almost ready to use httpoison to write the api call directly). The only difference in the config is the domain part: only use the your.domain part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants