Skip to content
Snippets Groups Projects
default.conf 2.67 KiB
Newer Older
  • Learn to ignore specific revisions
  • Etienne LOUPIAS's avatar
    Etienne LOUPIAS committed
    map $http_user_agent $outdated {
      default                                 0;
      "~MSIE [1-10]\."                        1;
      "~Trident/[5-7]\."                      1;
      "~Mozilla.*Firefox/[1-9]\."             1;
      "~Mozilla.*Firefox/[0-2][0-9]\."        1;
      "~Mozilla.*Firefox/3[0-1]\."            1;
      "~Opera.*Version/[0-9]\."               1;
      "~Opera.*Version/[0-1][0-9]\."          1;
      "~Opera.*Version/2[0-1]\."              1;
      "~AppleWebKit.*Version/[0-6]\..*Safari" 1;
      "~Chrome/[0-9]\."                       1;
      "~Chrome/[0-2][0-9]\."                  1;
      "~Chrome/3[0-3]\."                      1;
    }
    
    server {
      listen 8080 default_server;
    
      root /usr/share/nginx/html/;
    
      server_tokens off;
    
      ## get the calling real ip behind the haproxy ( https://nginx.org/en/docs/http/ngx_http_realip_module.html )
      set_real_ip_from 10.131.2.2;
      set_real_ip_from 10.4.75.2;
      real_ip_header X-Forwarded-For;
      ##real_ip_recursive on;
    
      #allow 10.131.2.2;       # haproxy
      #allow 10.131.0.2;       # probe
      #allow 10.128.4.2;       # probe
      #allow 80.14.51.82;      # Erasme
      #deny all;
    
    
    Etienne LOUPIAS's avatar
    Etienne LOUPIAS committed
      location ^~ /actualites/details/ {
          proxy_pass http://res-client-service:8080/api/render/;
      }
      
    
      location /data-grandlyon-cities {
        proxy_pass https://data.grandlyon.com/fr/datapusher/ws/grandlyon/adr_voie_lieu.adrcomgl/all.json;
      }
    
    
    Etienne LOUPIAS's avatar
    Etienne LOUPIAS committed
      location / {
        add_header X-Frame-Options SAMEORIGIN always;
        add_header X-Content-Type-Options nosniff;
    
        # Redirect outdated navigator
        if ($outdated = 1){
          rewrite ^ /outdated.html break;
        }
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        # Angular routed apps must fall back to index.html ( https://angular.io/guide/deployment#server-configuration )
        try_files $uri $uri/ /index.html;
      }
     
      location /api {
        proxy_pass http://res-server-service:3000;
      }
    
      # temp to remove  
      # https://ghost.org/docs/faq/proxying-https-infinite-loops/
      location ~* (/blog) {
        expires epoch;
        proxy_no_cache 1;
        proxy_pass http://res-ghost-service:2368;
      }
    
      location /base-adresse/base-adresse-nationale/streets {
        proxy_pass https://passerelle.formulaireextranet.grandlyon.com/base-adresse/base-adresse-nationale/streets;
      }
      
      location /geocoding/photon/api {
        proxy_pass https://download.data.grandlyon.com/geocoding/photon/api;
      }
      
      location /reverse {
        proxy_pass https://api-adresse.data.gouv.fr/reverse;
      }
    
      location /wfs/grandlyon {
        proxy_pass https://download.data.grandlyon.com/wfs/grandlyon;
      }
    
      # REALLY important for JavaScript modules (type="module") to work as expected!!!
      location ~ \.js {
        add_header  Content-Type   text/javascript;
      }
    
    }