Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Port 80 and 443 #903

Closed
aligneddev opened this issue Jun 1, 2016 · 4 comments
Closed

Port 80 and 443 #903

aligneddev opened this issue Jun 1, 2016 · 4 comments

Comments

@aligneddev
Copy link

Can I use Kestrel with port 80 and 443 and access it from remote computers on Windows 10?
My networking knowledge isn't what it should be.

http://stackoverflow.com/questions/34212765/how-do-i-get-the-kestrel-web-server-to-listen-to-non-localhost-requests was helpful, but netsh http add iplisten ipaddress=::80 didn't open up that port.

I also attempted to add a Firewall setting. http://stackoverflow.com/questions/7363470/windows-server-2008-r2-cant-get-apache-to-run-on-port-80

var host = new WebHostBuilder()
                .UseUrls("http://*:80", "https://*:443")
                .UseKestrel(options =>
                {
                    options.NoDelay = true;
                    options.UseHttps(testCertPath, configuration["pfxPassword"]);
                    options.UseConnectionLogging();
                })
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseStartup<Startup>()
                .Build();
            host.Run();
@Tratcher
Copy link
Member

Tratcher commented Jun 1, 2016

You need to remove all the netsh entries and disable IIS if you want Kestrel to listen on those ports. Kestrel doesn't use netsh/http.sys and can't share ports with it.

@moozzyk
Copy link
Contributor

moozzyk commented Jun 1, 2016

The recommended way is however to run Kestrel behind a proxy e.g. IIS or nginx

@aligneddev
Copy link
Author

Thanks and understood that IIS is recommended, I'm running this as an internal app, so I'm avoiding having to install the extra dependency.

@Tratcher does that include uninstalling IIS Express?

@Tratcher
Copy link
Member

Tratcher commented Jun 1, 2016

No, Express doesn't use those ports.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants