Join the community today
Register Now

Nginx 400 Bad Request error - do I have the right info here?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by PhoenixDown, Aug 11, 2016.

  1. PhoenixDown

    PhoenixDown New Member

    11
    0
    1
    Jun 16, 2014
    Ratings:
    +0
    Local Time:
    1:25 AM
    I have a new domain (amplifyself.com) and a new droplet on Digital Ocean. I am using the Name Cheap default DNS servers.


    When I go to the URL I get a NGINX message - 400 Bad Request. I am wonder if I set the DMS info in the domain incorrectly or if i missed a step on the install.

    Any advice would be great.

    thanks!
     

    Attached Files:

  2. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    3:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    2nd record should be an A record pointing to your server ip address
     
  3. PhoenixDown

    PhoenixDown New Member

    11
    0
    1
    Jun 16, 2014
    Ratings:
    +0
    Local Time:
    1:25 AM
    There's an A record with a host of WWW and an address of 192.241.187.175 (this is actually the IP assigned by DO). I never saw a 192 outside of home use before.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    3:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    then remove that url redirect record as maybe causing havoc ?

    though a HTTP 400 status is usually nginx level

    what's your nginx domain.com.conf and domain.com.ssl.conf look like content wise ?

    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)
     
    Last edited: Aug 11, 2016
  5. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    3:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    also you can go into nginx debug mode if you want to troubleshoot

    Latest update on September 14, 2015 to Centmin Mod 1.2.3-eva2000.08 stable (123.08stable) and higher has added Nginx debug mode support. Nginx debug mode is disabled by default.

    To enable, edit centmin.sh and change variable NGINX_DEBUG=n default to NGINX_DEBUG=y and recompile Nginx via centmin.sh menu option 4 and then setting error_log in nginx vhosts to debug as outlined at nginx.org/en/docs/debugging_log.html & wiki.nginx.org/Debugging.

    You do not want to leave Nginx debug mode running forever, so after debugging, set NGINX_DEBUG=n in centmin.sh and recompile Nginx again via centmin.sh menu option 4 and remove error_log debugging mode to disable Nginx debug mode again.

    To update your Centmin Mod builds code for Nginx debug mode support if you do not have a NGINX_DEBUG variable in centmin.sh, follow instructions at centminmod.com/upgrade.html and respective version threads below:

    Centmin Mod is provided as is, but you can try debugging mode for Nginx for further troubleshooting if you have problems with Nginx (i.e. segfaults / signal 11 issues) as outlined at nginx.org/en/docs/debugging_log.html & wiki.nginx.org/Debugging.
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    3:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Also any clues in your access.log and error.log in vhost listed paths at
    Code (Text):
    access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=60m;
    error_log /home/nginx/domains/domain.com/log/error.log;
    
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,857
    12,238
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,809
    Local Time:
    3:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    one more thing on the url link which has 400 bad requests do a curl check of the headers

    Code (Text):
    curl -I http://yourdomain.com/path/to/badrequest_url
     
  8. SeaTea

    SeaTea Member

    49
    13
    8
    Feb 20, 2015
    the Netherlands
    Ratings:
    +28
    Local Time:
    6:25 AM
    Nginx:1.11
    MariaDB-10
    Why does my browser connect to a completely different ip-address then ?
    Also nslookup shows:
    Code (Text):
    Non-authoritative answer:
    Name:    amplifyself.com
    Address: 162.255.119.249
    


    Edit:
    When connecting to http://your-ip-adress: Test Page for the Centmin Mod Nginx HTTP Server I get a Centminmod test-page...