小编Fre*_*ins的帖子

为子域问题设置 CNAME

我会为此设置:

  • 用户去 test.example_site1.org
  • test.example_org1.org 它是 test.example_org2.org 的 CNAME
  • 用户将看到 test.example_org2.org 的页面

在 example_org2.org 服务器上,我使用 nginx 并且我有 3 个 django 项目。

test.example_org2.org 展示了第三个 django 项目。http://example_org2.org展示了第一个 django 项目。

问题是我在 example_org1.org 上设置了一个 CNAME 以将 test.example_org1.org 指向 test.example_org2.org ,但是如果我尝试去http://test.example_org1.org我看到第一个django项目,其中一个配置到主域而不是子域。否则,如果我直接访问http://test.example_org2.org一切正常,我会看到正确的项目。

为什么会出现这个问题?

nginx django cname-record

6
推荐指数
2
解决办法
1万
查看次数

缓存控制apache错误

我已经输入了httpd.conf

# 480 weeks
<filesmatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</filesmatch>

# 2 days
<filesmatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</filesmatch>

# 2 hours
<filesmatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesmatch>
Run Code Online (Sandbox Code Playgroud)

但是当我运行时/etc/init.d/apache restart(在 Debian 6.0 中)我得到:

Syntax error on line 3 of /etc/apache2/httpd.conf:
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
 failed!
Run Code Online (Sandbox Code Playgroud)

cache apache-2.2

1
推荐指数
1
解决办法
2380
查看次数

标签 统计

apache-2.2 ×1

cache ×1

cname-record ×1

django ×1

nginx ×1