3

I usually don't post questions until I've researched it to death on the internet. I create a CSR using Laravel Forge, add the Certificate, activate it, edit the Nginx Config using these resources:

https://stackoverflow.com/questions/26192839/laravel-forge-ssl-certificate-not-working

^curl https://domain.com returns data

server {
  listen 80;
  server_name example.com www.example.com;
  return 301 https://example.com$request_uri;
}

server {
  listen 443 ssl;
  server_name example.com www.example.com;
  root /home/forge/example.com/public;

  # FORGE SSL (DO NOT REMOVE!)
  ssl_certificate /etc/nginx/ssl/vgport.com/3042/server.crt;
  ssl_certificate_key /etc/nginx/ssl/vgport.com/3042/server.key;

  index index.html index.htm index.php;

  charset utf-8;

  location / {
      try_files $uri $uri/ /index.php?$query_string;
  }

  location = /favicon.ico { access_log off; log_not_found off; }
  location = /robots.txt  { access_log off; log_not_found off; }

  access_log off;
  error_log  /var/log/nginx/default-error.log error;

  error_page 404 /index.php;

  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
  }

  location ~ /\.ht {
      deny all;
  }
}

I do 'service nginx restart' in command line, and go to /var/log/nginx/error.log and see the following error:

'conflicting server name "" on 0.0.0.0:80, ignored'
'conflicting server name "www.domain.com" on 0.0.0.0:80, ignored'

When I visit domain.com, it gets redirected to https://domain.com with 'This webpage has a redirect loop'. Clearly the Nginx redirect isn't working somehow but I've followed all the steps.

Please let me know what additional error logs and information I should post to troubleshoot this issue. Any help would be greatly appreciated, thanks in advance.

1
  • make sure you don't have any default configuration, something like /etc/nginx/conf.d/default.conf Commented Nov 9, 2014 at 18:05

2 Answers 2

4

okay so the problem was simpler than I thought. I was using the free cloudflare dns pointing which didn't support ssl. I switched to using the namescheap dns and it started working.

Sign up to request clarification or add additional context in comments.

Comments

3

After spending some time researching nginx, I'd just like to add that when you add a cert, you have to manually press "Activate it" once downloaded.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.