Questions tagged [server-name]

91 questions
3
votes
1 answer

Nginx server names priority

I have two server sections for nginx in different files. The first one: server { server_name _; ... } The second one: server { server_name ~someRegex; ... } I have some constraints - I can't change the first server section (i.e. I…
user3309314
  • 2,453
  • 2
  • 17
  • 30
3
votes
2 answers

nginx $server_name is always localhost

I have an nginx 1.4.5 server running on an AWS EC2 instance. I have two conf file: the default.conf and myapp.conf. The default.conf listen to localhost, and myapp.conf listen to myapp.mydomain.com. However I found even I type in myapp.mydomain.com…
Gelin Luo
  • 14,035
  • 27
  • 86
  • 139
3
votes
1 answer

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

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…
Niels
  • 230
  • 2
  • 7
2
votes
1 answer

kubernetes ingress server-alias only applies to one ingress host

According to this doc (https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#server-alias), I'm able to add additional server_name to the nginx config file. However, it adds the extra server_name to all of my hosts,…
2
votes
1 answer

How to test a server with a request without the “Host” header field

I have a server that is using Nginx's 444 to drop connections to undefined hosts: server { listen 80; server_name ""; return 444; } But I can't figure out how to test if it's working. Here are a few things I've tried,…
43Tesseracts
  • 4,617
  • 8
  • 48
  • 94
2
votes
2 answers

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

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…
John
  • 32,403
  • 80
  • 251
  • 422
2
votes
1 answer

How to login with newly created server name in sql server 2008

Basically problem starts from my c# code. it is showing error in my connection string. In connection i mentioned server name like, Chaitanya\SQLEXPRESS and at compile time it shows the error at " \ ". My Connection string SqlConnection con…
2
votes
1 answer

Nginx regular expression server_name

How can you use regular expression to do this: preprod.*.company.com > root to /home/preprod_folder *.company.com > root to /home/prod_folder I know that to match *.company.com I will create: server_name *.company.com But what about for a regular…
Xanarus
  • 763
  • 1
  • 6
  • 18
2
votes
1 answer

Nginx default server always selected - Multiple SSL servers

I have 3 servers defined in Nginx (wich is used for serving static contents and as proxy for tomcat) : One handling non-maching requests : server { listen 443 default_server; return 444; } One for web-app A : server { listen 443; …
N LAMY
  • 225
  • 1
  • 4
  • 14
1
vote
1 answer

Powershell command did not include error in output file

I have the code below, to be used in Powershell; it performed well, except that I need the output file to also include the error messages whenever the IPs did not resolve to names. Get-Content inputfile.txt | foreach-object {…
1
vote
4 answers

Get Sub-domain with PHP

How to get sub domain from URL. let say subdomain.example.com, then i want only subdomain Example : https://subdomain.example.com https://anything.example.com/pathurl Output : Subdomain anything Trying code from stackoverflow with some…
Stellan Coder
  • 323
  • 1
  • 11
1
vote
1 answer

Nginx propagate server_name regex inside Php

In my Nginx configuration there’s server_name ~^(?.*mygreatsite987778.com.invalid)$ ; Which works quite good. But When Php does echo $_SERVER['SERVER'], it sees: ~^(?.*mygreatsite987778.com.invalid)$ Despite it seems logical, is there a…
user15129590
1
vote
1 answer

Change nginx server name in Docker

I have a project running on docker. I use Nginx reverse proxy to run my app. All works fine but trying to personalize the server_name on nginx but couldn't figure out how. Docker yml file I've added server name to /etc/hosts by docker version:…
can onurer
  • 31
  • 1
  • 4
1
vote
1 answer

NGINX - How to check whether the requested domain and server_name (HOST header value) are same

I have multiple services running in a machine behind NGINX, Using server_name configured for few application's end points server { server_name my_app_1; listen *:443; .... } server { server_name my_app_2; listen *:443; …
Karthikeyan
  • 406
  • 3
  • 14
1
vote
1 answer

nginx direct trafic to non domain name using IP and local names

Using nginx on windows server I want to direct traffic into different ports using names that are non-domain names, first one works but second one never reach: why? what is wrong? http://192.xxx.xxx.xxx/game: works http://192.xxx.xxx.xxx/cms: never…
Ahmad Ebrahimi
  • 267
  • 5
  • 24