improve portal nginx config

please verify this config before merge, because it was not validated