Welcome to nginx! after droplet backup restore (emergency)

July 25, 2016 344 views
Nginx Backups Apache DigitalOcean DNS Ubuntu

My client has paid ads and visitors coming to their site and they're going crazy, so I'm a little frustrated here.


After restoring a droplet from when the site worked, I'm getting "Welcome to nginx!"

Following the instructions in this discussion:

I'm getting a 403 error

Nothing in:

Inside /etc/nginx/sites-available/default (comments removed):

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /var/www/;
        index index.html index.htm;

        server_name localhost;

        location / {

                try_files $uri $uri/ =404;


 location ~ /.well-known {
                allow all;

--- update as I'm troubleshooting ---

I used this tutorial to set up my droplet with wordpress:

I didn't install nginx, I installed Apache. I'm not sure why it was running.

I've stoped nginx and restarted apache but I'm getting an error:
/etc/init.d/apache2 restart

  • Restarting web server apache2 [fail]
  • The apache2 configtest failed. Output of config test was: AH00526: Syntax error on line 33 of /etc/apache2/sites-enabled/default-ssl.conf: SSLCertificateFile: file '/etc/letsencrypt/live/www.signa.com/cert.pem' does not exist or is empty Action 'configtest' failed. The Apache error log may have more information.

is not empty, there is a certificate inside I've just verified

Apache error logs (/var/log/apache2/error.log) only have logs from Yesterday, nothing from today

  • Since nginx and isn't your webserver and Apache is we need to see the apache config and the lines around line 33 to see if there are any syntax errors there.

    edited by BrookDO
  • default-ssl.conf:

    <IfModule mod_ssl.c>
            <VirtualHost _default_:443>
                    ServerAdmin webmaster@localhost
                    ServerName signa.com
                    ServerAlias www.signa.com
                    DocumentRoot /var/www/
                    ErrorLog ${APACHE_LOG_DIR}/error.log
                    CustomLog ${APACHE_LOG_DIR}/access.log combined
                    SSLEngine on
    **line33** SSLCertificateFile      /etc/letsencrypt/live/www.signa.com/cert.pem
                    SSLCertificateKeyFile /etc/letsencrypt/live/www.signa.com/privkey.pem
     <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                    SSLOptions +StdEnvVars
                    <Directory /usr/lib/cgi-bin>
                                    SSLOptions +StdEnvVars
                    BrowserMatch "MSIE [2-6]" \
                                    nokeepalive ssl-unclean-shutdown \
                                    downgrade-1.0 force-response-1.0
                    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
    SSLCertificateChainFile /etc/letsencrypt/live/www.signa.com/chain.pem

    File: /etc/apache2/httpd.conf

    <VirtualHost _default_:443>
    ServerName signa.com:443
    SSLEngine on
    SSLCertificateKeyFile /etc/apache2/ssl/signa.com.key
    SSLCertificateFile /etc/apache2/ssl/signa.com.cert
    ServerAdmin cling@jackrabbit.host
    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    ErrorLog ${APACHE_LOG_DIR}/errorSSL.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/accessSSL.log combined


    Mutex file:${APACHE_LOCK_DIR} default
    PidFile ${APACHE_PID_FILE}
    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 5
    HostnameLookups Off
    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    IncludeOptional mods-enabled/*.load
    IncludeOptional mods-enabled/*.conf
    Include ports.conf
    <Directory />
            Options FollowSymLinks
            AllowOverride None
            Require all denied
    <Directory /usr/share>
            AllowOverride None
            Require all granted
    <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
    AccessFileName .htaccess
    <FilesMatch "^\.ht">
            Require all denied
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    IncludeOptional conf-enabled/*.conf
    IncludeOptional sites-enabled/*.conf
1 Answer

I've restored the droplet once again to start over, this time I immediately stopped nginx and restarted apache as sudo. I wasn't restarting apache as sudo which seems to have caused the permission error.

Have another answer? Share your knowledge.