0c1844fc创建于 2022年1月24日历史提交
user       nginx nginx;
worker_processes  5;
error_log  logs/error.log;
pid        logs/nginx.pid;
worker_rlimit_nofile 8192;

events {
  worker_connections  4096;
}

http {
  include    /etc/nginx/mime.types;

  default_type application/octet-stream;
  log_format   main '$remote_addr - $remote_user [$time_local]  $status '
    '"$request" $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

  access_log   logs/access.log  main;
  sendfile     on;
  tcp_nopush   on;
  tcp_nodelay on;
  server_names_hash_bucket_size 128; # this seems to be required for some vhosts
  keepalive_timeout 300;
  proxy_read_timeout 300;
  proxy_connect_timeout 300;
  proxy_send_timeout 300;
  client_max_body_size 300M;
  underscores_in_headers on;
  gzip on;
  gzip_vary on;
  gzip_comp_level 4;
  gzip_min_length 256;
  gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
  gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

  resolver 127.0.0.11 valid=30s;

  server {
    listen       443 ssl;
    ssl_certificate /etc/ssl/local_testsigmaos_com.pem;
    ssl_certificate_key /etc/ssl/local_testsigmaos_com.key;
    server_name  local.testsigmaos.com;

    error_log    logs/testsigma.error.log debug;
    access_log   logs/testsigma.access.log  main;
    root	 /opt/app/angular;
    index	 index.html;

    location = / {
      rewrite /  https://$host/ui/ redirect;
    }

    location = /ui {
      rewrite /ui https://$host/ui/ redirect;
    }

    location = /ui/ {
      try_files /index.html =404;
    }

   location ~* ^/ui/(.+) {
      try_files /$1 /index.html =404;
    }

    location ~* ^/ui/.*\.(html|js|css|json|jpg|png|svg|woff2|ico|jpeg|map)$ {
      try_files $uri =404;
    }

    location ~* ^/assets/.*\.(html|js|css|json|jpg|png|svg|woff2|ico|jpeg|map)$ {
      try_files $uri =404;
    }

    location / {
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;
      proxy_pass http://localhost:9090;
    }
  }
}