I’ve added tihs in default.conf and now the page is not working:

server {
    listen       443 ssl;
    # server_name  localhost;

    expires $expires
1 Like

nginx really likes semicolons. (also, make sure the map is before the server block)


Yes, it works now. :smiley: Thanks.

Its weird why it lasts to 2037 when I put only 9d?

location ~* .(?:ico|css|js|gif|jpeg|jpg|png)$ {
expires 9d;
add_header Pragma public;
add_header Cache-Control “public”;

1 Like

because that location block is never executed, that 2037 is the “max” from your map


Yes, I’ve did this and it works now:

map $sent_http_content_type $expires {
        default                    off;
        text/html                  epoch;
        text/css                   10d;
        application/javascript     10d;
        ~image/                    10d;
        ~img/                      10d;
        image/png                  10d;
    }#map expires

But what you are saying is that this code is not used now:

location ~* .(?:ico|css|js|gif|jpeg|jpg|png)$ {
expires 9d;
add_header Pragma public;
add_header Cache-Control “public”;

How is that?

1 Like

I have no idea how nginx decides what location block to use.

1 Like

I’ve removed this CNAME as you said but I cannot remove the other since I’m using them to connect to my email there, it is hosted there. Will the mail work if I put them as slaves?

What do you mean only when you query co. zone? What is that? :smiley:

that was probably doing something, I asked what the purpose was, I did not tell you to remove it :smiley:

For the mail to work you need a MX record pointing to a name, and then that name needs to point to one (or more, usually two) IP addresses.

root@Quake:~# for ns in `dig co. ns +short |head -n1`; do dig @$ns ns; done

; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> ns
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50820
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 8, ADDITIONAL: 1
;; WARNING: recursion requested but not available

; EDNS: version: 0, flags:; udp: 4096
; COOKIE: ee87dfbc18d04c1ce39f7ae85e7cbff435436d79dc3433d0 (good)
;                    IN      NS

;; AUTHORITY SECTION:             3600    IN      NS             3600    IN      NS             3600    IN      NS             3600    IN      NS             3600    IN      NS             3600    IN      NS             3600    IN      NS             3600    IN      NS

;; Query time: 10 msec
;; SERVER: 2610:a1:1010::21#53(2610:a1:1010::21)
;; WHEN: Thu Mar 26 15:45:08 CET 2020
;; MSG SIZE  rcvd: 299

Your nameservers have mismatching zone versions because they’re two independent sets of nameservers. You need to choose one.

1 Like

I removed it because I thought it conflicted with, since * would parse mail?

Ok, so my MX is pointing to a name:


and now I need to point that name with an A record to the IP of the other server ( or to my aws server (

I understand now, how do I pick one? I’ve set in aws only my aws NS?

1 Like

to the server that handles your mail.

It’s a choice you’ll have to make for yourself, but only keep one set. In your registrar’s panel, not in aws.


Ok, but this is what I do not understand, if I remove “” server names, how can I have an email that is located there? And if I remove “ns.awsdns” servernames, how can I have an landing page that is located there?

1 Like

You get one set to point to services on the other provider.


Are you sure, I’ve tried to explain once again what is happening:

I have domain, and I’ve put in my domain register 8 server names, 4 by AWS and 4 by Eukhost.


I’m using AWS with ec2 instance in combination with docker-compose where I have Nginx, client,server, database, and one machine learning model ports. (Recordsets -

However, I’m using Eukhost for my email which works perfectly with number and there I login successfully. (Recordsets -

Since I have a contact form on my landing page which I connected with that email I had problems with getting mail through so I wanted that connects to the IP address but now that has caused some bigger mixups.

Here are some issues I’m experiencing:

  1. When I and many people that tested for me run “tracert DOMAIN_NAME”, this usually happens, it doesn’t connect or barely connects -
  2. Some people when they go on got redirected to my email page?
  3. When I run a test on -
1 Like

You can use both in one case and one case only: they are perfectly synchronized.

You can use eukhost only or amazon only, your mail will work as long as the mx record is right, wherever it is. (and txt/spf, etc…)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.