SHARE
TWEET

Untitled

a guest Jun 13th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. map $request_uri $sub {
  2.     default       front;
  3.     ~^/api/.*     api;
  4.     ~^/rest/.*    rest;
  5. }
  6.  
  7. map $host $sub {
  8.     hostnames;
  9.  
  10.     #default    $sub; # Tried, no success
  11.  
  12.     ping.*     ping;
  13.     admin.*    admin;
  14. }
  15.  
  16. server {
  17.     listen 80;
  18.     server_name _;
  19.  
  20.     root /usr/share/nginx/html;
  21.  
  22.     location / {
  23.         add_header X-Sub $sub;
  24.         try_files $uri $uri/ /index.html;
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top