0

When visit: www.fxmates.com/ => return 404

visit: https://fxmates.com/ => OK

Here's my Nginx config file:

enter image description here

What's wrong?

Ridwan
  • 171
  • 1
  • 10
Hyou
  • 3
  • 1
  • Please, add the nginx config file as file. Images are harder to manage in this context. And, the title of your question does not match the body. – Sourcerer Jan 17 '21 at 11:30
  • Please take a look at: https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557 – ghilesZ Jan 17 '21 at 12:08

1 Answers1

0

There are multiple errors in your code actually:

Firsty, in the line: enter image description here

Make it:

server_name fxmates.com www.fxmates.com;

Also, remove this line:

enter image description here It's what causes your nginx webserver to give the user a 404 page each and everytime the user goes to any page on fxmates.com on http://fxmates.com, since in any browser when you type fxmates.com only without https:// the browser defaults to http:// and then the return 404 block pushes 404 to the user's browser.

And the reason this doesn't effect you when you're directly typing https:// in front because, nginx uses the above server block in the configuration file.


Hope it helps.

Ridwan
  • 171
  • 1
  • 10