我会为此设置:
在 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一切正常,我会看到正确的项目。
为什么会出现这个问题?
我已经输入了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)