Articles of 子域

IIS7中的通配符子域。 是否有可能让它们像Apache一样?

这是可能的configurationIIS7实现相同的function,如Apache有关通配符域? 我对基于URL中使用的子域用户的ASP.NET Web应用程序中的用户进行路由感兴趣。 类似这样描述: http://steinsoft.net/index.php?site=programming/articles/apachewildcarddomain 谢谢

Rails应用程序和乘客的nginx子域失败

我对nginx部署是完全陌生的,并且遇到了在乘客中运行rails应用程序的子域的问题。 我的应用程序结构是这样的 — sss.com (parent domain) — sub.sss.com (subdomain) — zzz.com (which will be redirected to sub.sss.com) 为了更清晰的视angular,请考虑一下gmail结构 — google.com (parent domain) – mail.google.com (subdomain) — gmail.com (which will be redirected to mail.google.com) 请记住,sub.sss.com不只是sss下的一个目录,它完全是一个不同的rails应用程序。 要设置一个类似的结构,我已经configurationnginx像这样 server { listen 80; server_name sss.com *.sss.com; rewrite ^(.*) http://sss.com$1 permanent; } server { listen 80; server_name sss.com; passenger_enabled on; […]

创build一个只能访问特定页面的子域别名

背景 我们正在为希望有一个“白标”解决scheme的人运行一个项目(他们希望有一个他们的网站的子域,显示我们网站的某些页面,样式看起来像他们的)。 我们倾向于这条路线的主要原因是他们的用户觉得他们没有离开原来的网站(或者他们是相关的),并且客户是坚持的。 计划 在我们的服务器上指定一个子域名,但只允许它访问与此项目相关的页面(否则我们的常规站点页面会混淆人)。 我们的前端堆栈只是一个内置单页应用程序的小型Nginx服务器。 我们没有从这个地区的任何导航到其他地区,但是如果path没有被阻挡,人们仍然可以到达那里。 我们想要访问的页面是: example.example.com/profiles/* configuration文件是正在开发的网站的新领域 // example.example.com只是other.com的别名 问题 什么是最可靠的方式来确定请求者是使用子域还是我们的主域? 那么我们可以提供一个404到/ profiles / *页面之外的请求吗? 使用服务器configuration(Nginx)或路由拦截器(AngularJS)做这个更好吗?

如何将rails应用程序的nginxconfiguration为子域名?

我开发了rails应用程序,它在域mpm.head-system.com上工作在我的VPS上,应用程序位于/home/mobile_market path 。 这是nginx.conf: user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 1024; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_tokens off; server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; gzip_types text/plain text/xml text/css text/comma-separated-values; upstream app_server { server […]

Rails 4个子域名不适用于生产

我创build了一个包含3个子域的Rails 4应用程序。 发展领域: mydomain.dev api.mydomain.dev account.mydomain.dev 生产领域(带乘客的Ngnix): app.mydomain.com(www.mydomain.com和mydomain.com显示其他页面,而不是应用程序) api.mydomain.com account.mydomain.com 我的config / routes.rb看起来像这样: Rails.application.routes.draw do namespace :api, constraints: { subdomain: 'api' }, path: '/', defaults: { format: :json } do namespace :v1 do resources :clients, only: [:create, :show] end end namespace :account, constraints: { subdomain: 'account' }, path: '/' do get '/:locale' => 'welcome#index', locale: […]

nginx – 将domain.com:port重写到sub.domain.com

我怎样才能重写一个域的端口到一个子域? eq: domain.com:3000 : domain.com:3000到sub.domain.com ? 谢谢你的帮助! 🙂 格尔茨

nginx服务器configuration:子域到文件夹

我从Apache 2迁移到nginx,我有问题来处理我的子域控制。 我想要什么:当请求x.domain.tld时, 内部重写为domain.tld / x 我得到的问题是nginx总是通过告诉浏览器redirect到页面来redirect页面。 但是我真正想要的是在内部做这个,就像Apache 2一样。 此外,如果我只请求x.domain.tld,nginx返回一个404。它只适用于当我做x.domain.tld / index.php 这是我的configuration: server { listen 80 default; server_name _ domain.tld www.domain.tld ~^(?<sub>.+)\.domain\.tld$; root /home/domain/docs/; if ($sub) { rewrite (.*) /$sub; } # HIDDEN FILES AND FOLDERS rewrite ^(.*)\/\.(.*)$ @404 break; location = @404 { return 404; } # PHP location ~ ^(.*)\.php$ { if […]

如何testing本地主机上的nginx子域名

我想在将configuration上传到服务器之前testingnginx子域名。 我可以在本地主机上testing吗? 我试试 server { listen 80; server_name localhost; location / { proxy_pass http://localhost:8080; } } server { listen 80; server_name sub.localhost; location / { proxy_pass http://localhost:8080/sub; } } 它不起作用。 Shoulld我改变我的主机文件,以使其工作? 另外,上传网站后,我应该更改DNSlogging,并添加sub.mydomain.com服务器?

在nginx上设置子域名

我试图在nginx上设置一个子域名。 我的设置是在端口8080上运行的一个Pylons应用程序,并使用来自nginx的代理。 我试图让子域名工作的原因是最终设置了开发和登台服务器。 这是我的nginx.conf文件: worker_processes 2; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; access_log logs/rentfox.access.log; error_log logs/rentfox.error.log; gzip on; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 75 20; server { listen 80; server_name xxx.net; location / { include /usr/local/nginx/conf/proxy.conf; proxy_pass http://127.0.0.1:8080; proxy_redirect default; root /var/apps/xxx/xxx/public/; } #error_page 404 /404.html; # redirect […]

nginx子域configuration

我有nginx作为一个反向代理到Apache。 我现在需要添加一个新的子域,它将提供另一个目录中的文件,但是同时我希望所有位置和proxy_pass指令都具有默认主机也适用于子域。 我知道,如果我从默认主机复制规则到新的子域它将工作,但有没有办法让子域inheritance规则? 以下是一个示例configuration server { listen 80; server_name www.somesite.com; access_log logs/access.log; error_log logs/error.log error; location /mvc { proxy_pass http://localhost:8080/mvc; } location /assets { alias /var/www/html/assets; expires max; } … a lot more locations } server { listen 80; server_name subdomain.somesite.com; location / { root /var/www/some_dir; index index.html index.htm; } } 谢谢