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

# document root #
     root        /usr/share/nginx/html;

	# Everything is a 404
	# location / {
	# 	return 404;
	# }
	
    location /admin/api/ {
        client_max_body_size 96m;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        rewrite ^/admin/api/?(.*) /$1 break;
        proxy_pass http://market-server:8081;
        proxy_redirect off;
    }

    # location / {
    #     autoindex on;
    #     add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
    #     autoindex_exact_size on;
    #     root /usr/share/nginx/html;
    #     }

 #   location ~ /files/.*/key.pub {
 #       rewrite ^ /key.pub permanent;
 #   }
    # location ^~ /key.pub {
    #     rewrite ^/key.pub$ /key.pub/key.pub? last;
    # }

    # location ^~ /app.json {
    #     rewrite ^/app.json$ /files/mediaoperator/app.json? last;
    #     add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
    # }

    



	# You may need this to prevent return 404 recursion.
	location = /404.html {
		internal;
	}
}
