server-name

newbie .net question - variable that's equivalent of $_SESSION['SERVER_NAME']

女生的网名这么多〃 提交于 2019-12-24 01:27:51
问题 I'm still new to .net....I'm trying to find the variable that prints the domain name that an aspx.cs file is currently executing from. I come from PHP land, and it has $_SERVER['SERVER_NAME'] or $_SERVER['HTTP_HOST']. What's the .net equivalent for those variables? Thanks 回答1: You have all that in: HttpContext.Current.Request.Url In that object you have the Domain, AbsoluteUri, AbsolutePath, etc. Please see this question and this link for more references 回答2: Request.ServerVariables["SERVER

Changing Tomcat server name in response header, is that possible?

感情迁移 提交于 2019-12-22 08:04:17
问题 When a http request from a browser is made, typically the server container will send along in the header what server it was. For tomcat it sends Server:Apache-Coyote/1.1 I know I can overwrite this header, for each request, but there is also the case for websockets and potentially other connections. So, is there a way to change this at the tomcat configuration level? 回答1: I just found this after posting the question: Add this to server.xml in tomcat config folder. <Connector port="8080"

nginx server_name wildcard or catch-all

北战南征 提交于 2019-12-18 09:57:22
问题 I have an instance of nginx running which serves several websites. The first is a status message on the server's IP address. The second is an admin console on admin.domain.com . These work great. Now I'd like all other domain requests to go to a single index.php - I have loads of domains and subdomains and it's impractical to list them all in an nginx config. So far I've tried setting server_name to * but that failed as an invalid wildcard. *.* works until I add the other server blocks, then

is it possible to specify vim servername in .vimrc, or somewhere else, according to filetype?

岁酱吖の 提交于 2019-12-10 18:26:02
问题 I have to type gvim --servername xdvi toto.tex to enable inverse search from xdvi to latex. Is there a way to encapsulate this in .vimrc : when vim detects the .tex file, an autocmd sets the servername to vimrc ? It seems it is too late once vim is launched, or? If not in .vimrc , where ? 回答1: The special v:servername variable is read-only; you cannot change it from within Vim. If you need a certain servername, that has to be specified on startup via the --servername argument. To avoid the

Can $_SERVER['SERVER_NAME'] be forged/faked?

只谈情不闲聊 提交于 2019-12-10 05:38:54
问题 Can the PHP variable $_SERVER['SERVER_NAME'] be forged or faked? I was planning on using that as a security measure for form posting. I would check to make sure that variable is my site name (www.example.com). I know HTTP_REFERRER can be faked, but I wasn't sure on this one. Thanks! 回答1: Actually $_SERVER['SERVER_NAME'] can be affected by what the client browser sends over... See http://shiflett.org/blog/2006/mar/server-name-versus-http-host for a through investigation on the issue. 回答2: By a

Apache Virtual Host is not working right

北慕城南 提交于 2019-12-08 16:37:46
问题 Somehow my Virtual host files are not working straight I can't tell why - I bet it's just a mailfunction in my good-morning brain :p Right now I got TWO sites enabled via a symbolic link to sites available in /etc/apache2/ directory like : 0 Nov 21 12:24 000-default -> ../sites-available/default 0 Nov 21 14:52 001-site -> ../sites-available/site my VHosts files look like : DEFAULT <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName (the IP Address from my Server) ServerAlias (the

Can $_SERVER['SERVER_NAME'] be forged/faked?

↘锁芯ラ 提交于 2019-12-05 10:54:04
Can the PHP variable $_SERVER['SERVER_NAME'] be forged or faked? I was planning on using that as a security measure for form posting. I would check to make sure that variable is my site name (www.example.com). I know HTTP_REFERRER can be faked, but I wasn't sure on this one. Thanks! Actually $_SERVER['SERVER_NAME'] can be affected by what the client browser sends over... See http://shiflett.org/blog/2006/mar/server-name-versus-http-host for a through investigation on the issue. By a visitor it can't normally be faked out. But I suspect you would want to enforce a certain SERVER_NAME to license

OpenSSL::SSL::SSLContext SNI servername_cb Not Working

主宰稳场 提交于 2019-12-04 03:55:04
问题 As referenced in OpenSSL::X509::Certificate Showing Certificate for Wrong Domain, I need to use TLSv1 or above and Server Name Indication extension. Even with ssl_version and servername_cb set via the SSLContext , I'm still getting the wrong certificate for myproair.com . begin timeout(1) do tcp_client = TCPSocket.new("#{instance["domain"]}", 443) ssl_context = OpenSSL::SSL::SSLContext.new() ssl_context.ssl_version = :TLSv1 ssl_context.servername_cb = "https://#{instance["domain"]}" ssl

nginx server_name wildcard or catch-all

末鹿安然 提交于 2019-11-29 18:56:02
I have an instance of nginx running which serves several websites. The first is a status message on the server's IP address. The second is an admin console on admin.domain.com . These work great. Now I'd like all other domain requests to go to a single index.php - I have loads of domains and subdomains and it's impractical to list them all in an nginx config. So far I've tried setting server_name to * but that failed as an invalid wildcard. *.* works until I add the other server blocks, then I guess it conflicts with them. Is there a way to run a catch-all server block in nginx after other