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

proxy/ssl produces an invalid nginx config #938

Closed
NitroBAY opened this issue Apr 30, 2018 · 14 comments

Comments

Projects
5 participants
@NitroBAY
Copy link

commented Apr 30, 2018

module.exports = {
servers: {
one: {
host: 'XXXXXXXXX',
username: 'root',
password: '8001CONCHItta',
// pem: './path/to/pem'
// or neither for authenticate from ssh-agent
},
},

proxy: {
domains: 'XXXXXXXXXXX',
ssl: {
// Enable let's encrypt to create free certificates
letsEncryptEmail: 'XXXXX@XXXXX.com',
},
},

app: {
name: 'pharma',
path: '../',

servers: {
  one: {},
},

buildOptions: {
  serverOnly: true,
},

env: {
  ROOT_URL: 'XXXXXXXXXXX',
},

docker: {
  image: 'abernix/meteord:node-8.4.0-base',
  networks: [
    'pharma',
  ],
},

// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true,
deployCheckWaitTime: 60, // default is 60 (optional)

},
};

Hey I have meteor 1.6 project that used to work before update, mup 1.4.4, the node version on my client is v8.11.1.
I've ofc replaced some sensitive data by XXXXXX.
When I don't have proxy server works. When I do have the mup-nginx-proxy keeps restarting if I docker logs it it logs 2018/04/30 01:45:45 [emerg] 25#25: unexpected end of file, expecting ";" or "}" in /etc/nginx/conf.d/my_proxy.conf:2 nginx.1 | nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/conf.d/my_proxy.conf:2 I don't know how to log the conf file as I cannot docker exec on a restarting container nor on a stopped one.

@zodern zodern added the Bug label Apr 30, 2018

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 1, 2018

Do you @zodern have some sort of clues about what's going on ?

@zodern

This comment has been minimized.

Copy link
Owner

commented May 1, 2018

Could you please show me the output of running cat /opt/mup-nginx-proxy/config/nginx-default.conf on the server? That file is mounted as my_proxy.conf inside the Docker container.

@stefanve

This comment has been minimized.

Copy link

commented May 2, 2018

Maybe not related, but for me the new reverse proxy thing does not work when more than one domain:

proxy: { domains: 'a.a.com, b.a.com, c.a.com', ssl: { letsEncryptEmail: 'abc@domain.com', }, },

above works with single domain but fails with comma delimited. Using the old syntax it still works:
ssl: { autogenerate: { email: 'abc@domain.com', domains: 'a.a.com, b.a.com, c.a.com' } },

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 13, 2018

@stefanve thanks but using the old syntax haven't changed my problem.
client_max_body_size 10M for ngninx-default in the server. As I try to explained I don't know how to access the data of a forever restarting container so how can I access my_proxy.conf ?
I've been using uncrypted server for weeks but this is very problematic as all old users are redirect to https version which is not working as I used to force ssl.

@zodern

This comment has been minimized.

Copy link
Owner

commented May 13, 2018

@NitroBAY the file is at /opt/mup-nginx-proxy/config/nginx-default.conf on the server, not in the container. It is mounted in the container as my_proxy.conf. Could you please show me the content of the file by running cat /opt/mup-nginx-proxy/config/nginx-default.conf on the server?

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 13, 2018

I've already shown you. On the server cat /opt/mup-nginx-proxy/config/nginx-default.conf is client_max_body_size 10M.
With or without https it is the same output.

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 13, 2018

This is really only that. There's nothing else than what I've reported.

@stefanve

This comment has been minimized.

Copy link

commented May 13, 2018

Again, possibly unrelated, but when I have deploy problems I usually start with stopping and removing all the existing containers (except mongo). On one machine I have to also remove the entire /opt/myapp/ dir.
Can be worth a try if you have not already done that.

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 13, 2018

I've been trying something similar but I didn't removed the opt/myapp folder I'll give a try thanks sir.

@zodern

This comment has been minimized.

Copy link
Owner

commented May 13, 2018

Thanks @NitroBAY. If you add a semicolon to the end of the in the file, it should work. I will create a permanent fix in the next update.

@zodern zodern added the Proxy label May 13, 2018

@zodern zodern added this to TODO in 1.4 via automation May 13, 2018

@zodern zodern moved this from TODO to In Progress in 1.4 May 13, 2018

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 13, 2018

Redeploying after deleting some opt's folders have fixed my issue. Much sorry to the time I made you lost, I still don't get how this little file got "corrupted". I'm clueless. Thanks a lot @zodern your support was really great and quick.

@NitroBAY NitroBAY closed this May 13, 2018

1.4 automation moved this from In Progress to Done May 13, 2018

@NitroBAY

This comment has been minimized.

Copy link
Author

commented May 13, 2018

Oh yeah and thank you @stefanve. Your solution was helpful.

@Remeus

This comment has been minimized.

Copy link

commented May 28, 2018

Same problem here, adding the semi-colon in /opt/mup-nginx-proxy/config/nginx-default.conf allowed the proxy to finally start.

@IDCOLL

This comment has been minimized.

Copy link

commented Feb 8, 2019

Redeploying after deleting some opt's folders have fixed my issue. Much sorry to the time I made you lost, I still don't get how this little file got "corrupted". I'm clueless. Thanks a lot @zodern your support was really great and quick.

I have had this same issue yesterday. I am using the latest MUP and I will described what I did to make the problem occur and steps taken to solve it.

  1. My app was running Meteor 1.5xxx and using SSL and Proxy. Everything was fine.
  2. Updated my settings.json file to include some information for the first time.
  3. Did a mup setup and mup deploy,
  4. App could not be accessed through the browser, after using the "mup docker sp" function released the proxy was constantly restarting.
  5. Did a Meteor upgrade to 1.8xxx and ensured my docker image used was correct (didn`t solve the problem),
  6. Add a ; to the end of the nginx-default.conf as mentioned here. (didn`t solve the problem)
  7. Deleted the /opt/mup-nginx-proxy folder and "MyApp" folder on the server
  8. Did a Mup setup and deploy and the problem was solved.

Hope this helps somebody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.