Question

nginx conf for dokku was overwritten

Posted September 12, 2014 5.4k views

In the process of installing dokku plugins (dokku plugins-install), I accidentally overwrite the nginx.conf file. As a result, all of my apps are returning a 502 Bad Gateway error.

Is there a way for me to fix this/ restore the original config?

3 comments
  • Remove /etc/nginx/conf.d/dokku.conf and run /var/lib/dokku/plugins/nginx-vhosts/install

    If you’re talking about application specific nginx.conf - just re-deploy it (by setting a config var for an instance)

  • Thanks Puck, I just did that and got this error. Any thought?

    /var/lib/dokku/plugins/nginx-vhosts/install: line 36: /HOSTNAME: No such file or directory
    cp: cannot stat ‘/HOSTNAME’: No such file or directory
    
  • So I was able to solve the problem I had by running a simple command before reinstall the plugin.

    $ export DOKKU_ROOT=/home/dokku
    

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

This question was answered by @tridnguyen:

So I was able to solve the problem I had by running a simple command before reinstall the plugin.

$ export DOKKU_ROOT=/home/dokku

You can see the comment here.

Submit an Answer