Getting Error 503 when I using my site via DNS

0 votes

R53--->ELB(Classic+SSL)--->Nginx(just one instance)

My application is running on my Nginx server which is on port 80, there's no problem with the Nginx Instance, it's working perfectly  and I can even use it via its public IP.

I have now placed an ELB in my  Nginx , ELB registers my instance as healthy and I can hit ELB(classic) public URL to reach my website and I am terminating SSL on ELB itself

Now when I am placing a CNAME entry on Route53 ,and point this to my ELB I reach to

503 Service Unavailable : No server is available to handle this request.

I've been trying out many ways but not sure why is it happening.

My Nginx file looks like this :

server {
        listen 80 ;
        listen [::]:80;

        root /home/ubuntu/partner/public;
        index index.html index.htm index.nginx-debian.html;

        # Make site accessible from

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

        #return 301 $schema://$request_uri;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
Apr 25, 2018 in AWS by Flying geek
• 3,280 points

1 answer to this question.

0 votes

add the server_name directive to your Nginx config.
 Also, see How Nginx processes a request.

Server names are always defined by using the server_name directive and determine which server block is used for that given request. Also, check“How Nginx processes a request”. They may be defined using exact names, wildcard names, or regular expressions:

   server_name <Your Route53 Domain Name>
answered Apr 25, 2018 by Cloud gunner
• 4,670 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

Invalid hostname error when connecting to S3 using secret key

Hey, it works perfectly fine you just ...READ MORE

answered Oct 11, 2018 in AWS by Archana
• 4,170 points
0 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP