Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ubuntu 18 + asp.net core 3.1 + apache 2.4.29 = Status Code 500/502

$
0
0

can someone help me with this issue? Sometimes i'm getting  Status Code 500/502 and i can't  find out source of this problem

.сonf file  -> sites-available

#<VirtualHost *:*>
# RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
#</VirtualHost>

<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse / http://127.0.0.1:5000/
ServerName www.example.com
ServerAlias *.example.com
ErrorLog ${APACHE_LOG_DIR}site-error.log
# CustomLog ${APACHE_LOG_DIR}site-access.log common
</VirtualHost>

<VirtualHost *:443>
ServerAdmin webmaster@monopoliya.net
ServerName docs.monopoliya.net
ErrorLog ${APACHE_LOG_DIR}/error.log
# CustomLog ${APACHE_LOG_DIR}/access.log combined

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

SSLEngine on
SSLProxyEngine On
SSLCertificateFile /etc/apache2/ssl/site_net.crt
SSLCertificateKeyFile /etc/apache2/ssl/site.net.key


ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse / http://127.0.0.1:5000/
</VirtualHost>




service

[Unit]
Description=site

[Service]
WorkingDirectory=/var/www

# ExecStart=/usr/share/dotnet/dotnet /var/www/site.dll
ExecStart=/usr/bin/dotnet /var/www/site.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=site
User=DotNetUser
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target




and log

[Tue Mar 03 08:37:17.480673 2020] [proxy_http:error] [pid 52938:tid 139622659118848] (20014)Internal error (specific information not available): [client 10.75.5.126:10283] AH01102: error reading status line from remote server 127.0.0.1:5000, referer: http://10.75.0.128/
[Tue Mar 03 08:37:25.082441 2020] [proxy_http:error] [pid 52938:tid 139622139033344] (20014)Internal error (specific information not available): [client 10.75.5.126:10295] AH01102: error reading status line from remote server 127.0.0.1:5000, referer: http://10.75.0.128/
[Tue Mar 03 09:03:53.558072 2020] [proxy_http:error] [pid 52938:tid 139623095310080] (20014)Internal error (specific information not available): [client 10.75.5.126:1236] AH01102: error reading status line from remote server 127.0.0.1:5000, referer: http://10.75.0.128/
[Tue Mar 03 09:03:54.906938 2020] [proxy_http:error] [pid 52938:tid 139622675904256] (20014)Internal error (specific information not available): [client 10.75.5.126:1241] AH01102: error reading status line from remote server 127.0.0.1:5000, referer: http://10.75.0.128/
[Tue Mar 03 09:03:55.017393 2020] [proxy_http:error] [pid 52938:tid 139622642333440] (20014)Internal error (specific information not available): [client 10.75.5.126:1245] AH01102: error reading status line from remote server 127.0.0.1:5000, referer: http://10.75.0.128/
[Tue Mar 03 09:03:55.017506 2020] [proxy:error] [pid 52938:tid 139622642333440] [client 10.75.5.126:1245] AH00898: Error reading from remote server returned by /User/CheckAccess, referer: http://10.75.0.128/

and program.cs

public static IHostBuilder CreateHostBuilder(string[] args) =>
    /*     Host.CreateDefaultBuilder(args)
             .ConfigureWebHostDefaults(webBuilder => {
               webBuilder.UseStartup<Startup>();
             });
             */

      Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder => {
          webBuilder.ConfigureKestrel(serverOptions => {
            serverOptions.Limits.MaxConcurrentConnections = 500;
            serverOptions.Limits.MaxConcurrentUpgradedConnections = 100;
            serverOptions.Limits.Http2.MaxStreamsPerConnection = 200;
            //serverOptions.Limits.MaxRequestBodySize = 10 * 1024;
            serverOptions.Limits.MinRequestBodyDataRate =
                new MinDataRate(bytesPerSecond: 100,
                    gracePeriod: TimeSpan.FromMinutes(10));
            serverOptions.Limits.MinResponseDataRate =
                new MinDataRate(bytesPerSecond: 100,
                    gracePeriod: TimeSpan.FromMinutes(10));

            serverOptions.Listen(IPAddress.Loopback, 5000);
            serverOptions.Listen(IPAddress.Loopback, 5001);
            serverOptions.Limits.KeepAliveTimeout =
                TimeSpan.FromMinutes(300);
            serverOptions.Limits.RequestHeadersTimeout =
                TimeSpan.FromMinutes(60);
            serverOptions.Limits.KeepAliveTimeout =
                TimeSpan.FromMinutes(20);
            serverOptions.Limits.RequestHeadersTimeout =
                TimeSpan.FromMinutes(10);
            serverOptions.Limits.Http2.MaxStreamsPerConnection = 100;
            serverOptions.Limits.Http2.HeaderTableSize = 4096;

          })
          .UseStartup<Startup>();
        });

    /*Host.CreateDefaultBuilder(args)
        .ConfigureServices((context, services) => {
          services.Configure<KestrelServerOptions>(
              context.Configuration.GetSection("Kestrel"));
        })
        .ConfigureWebHostDefaults(webBuilder => {
          webBuilder.UseStartup<Startup>();
        });*/
  }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>