Что происходит с Program.Main, когда приложение ASP.NET Core выполняется в IISIntegration?

Наконец-то получил ответ. Мне нужно изменить файл nginx.conf.

    events {
  worker_connections  4096;  ## Default: 1024
}

    http {

      # Change this depending on environment

        upstream api {
            server 192.168.0.1:9998;
            #put here node.js ip with port
          }

          server {
            listen       80;
            server_name  localhost;

            root   /usr/share/nginx/html;
            index  index.html index.htm;
            include /etc/nginx/mime.types;

            location / {
              # If you want to enable html5Mode(true) in your angularjs app for pretty URL
              # then all request for your angularJS app will be through index.html
              try_files $uri /index.html;
            }

            # /api will server your proxied API that is running on same machine different port
            # or another machine. So you can protect your API endpoint not get hit by public directly
            location /api {
              proxy_pass http://api;
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection 'upgrade';
              proxy_set_header Host $host;
              proxy_cache_bypass $http_upgrade;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }

            #Static File Caching. All static files with the following extension will be cached for 1 day
            location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
              expires 1d;
            }
          }
        }
0
задан Simone 19 January 2019 в 17:57
поделиться

1 ответ

, так как есть немного больше, я решил добавить остальную часть кода, который я использовал для него

var scopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
        using (var scope = scopeFactory.CreateScope())
        {
            var db = scope.ServiceProvider.GetRequiredService<DbContext>();
            db.Database.Migrate();
        }
0
ответ дан markorial 19 January 2019 в 17:57
поделиться
Другие вопросы по тегам:

Похожие вопросы: