server {
	listen       80;
	listen  [::]:80;
	server_name  nginx;
	
	proxy_set_header X-Context $remote_addr-$connection;
	proxy_set_header X-Extern-Url $scheme://$host$request_uri;
	proxy_set_header X-Extern-Domain $scheme://$host;
	proxy_set_header X-User-Agent $http_user_agent;

	proxy_set_header X-Public "1";

	rewrite ^/shuffle/$ /search?query=browse:random&profile=yolo;
	rewrite ^/explore/(.*)$ /search?query=browse:$1&profile=yolo;
	rewrite ^/links/(.*)$ /search?query=links:$1&profile=corpo;

	location /screenshot {
		proxy_pass http://assistant-service:5025/public/screenshot;
	}
	location /site-search {
		proxy_pass http://search-service:5023/public/site-search;
	}
	location /site/suggest {
		proxy_pass http://search-service:5023/public/site/suggest;
	}
	location /site/flag-site {
		proxy_pass http://search-service:5023/public/site/flag-site;
	}
	location /site/ {
		rewrite ^/site/(.*)$ /search?query=site:$1&profile=yolo;
	}
	location /suggest/ {
        proxy_pass http://assistant-service:5025/public$request_uri;
        access_log off;
	}
	location / {
		proxy_pass http://search-service:5023/public/;
	}

}
