1

When I try to access my webserver, I get a blank page. It is set up to work with wordpress, but it doesn't.

This is my wordpress.conf (located in conf.d):

server {
  listen 80;
  #listen 443 default ssl;

  server_name snapecraft.ddns.net;
  root /var/www/html;

  #ssl_certificate /etc/nginx/ssl/mydomain.crt;
  #ssl_certificate_key /etc/nginx/ssl/mydomain.key;

  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log error;

  index index.php index.phtml index.html;

  error_page   500 502 503 504 404  /50x.html;

  location = /50x.html {
        root   /usr/share/nginx/html;
  }


  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_intercept_errors on;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;

  }
}

When I do curl -I snapecraft.ddns.net this is the result:

HTTP/1.1 301 Moved Permanently
Server: nginx/1.15.5
Date: Fri, 26 Oct 2018 16:41:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Location: https://snapecraft.ddns.net/

This is my nginx.conf:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

This is the php.ini file: https://pastebin.com/P6UccG70

Of course I reloaded nginx and PHP

Thank you very much for your help!

0

WordPress can be set to force https, but you have commented those lines out on your wordpress.conf. Your server is not answering on HTTPS, but does a redirection to it.

You have two options:

  1. Make http://snapecraft.ddns.net/ (without TLS) the canonical address for your site.
  2. Set up the TLS enabled https://snapecraft.ddns.net/.

This day and age you should choose option 2.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.