其中一个AWS子域不工作,带有dev的子域(dev.example.com)不工作



我创建了两个子域test.xxxxxx.com和dev.xxxxxx.com,test.xxxxxxcom运行良好,但dev.xxxxxxcom不工作。

dev.xxxxxx.com用于托管Laravel API,而test.xxxxxx.com则用于主机前端以用于开发目的。相同的

test.xxxxxx.com conf

<VirtualHost *:80>
ServerName test.xxxxxx.com
ServerAlias www.test.xxxxxx.com
DocumentRoot /var/www/test.xxxxxx.com/html/
<Directory /var/www/test.xxxxxx.com/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

dev.xxxxxx.com conf

<VirtualHost *:80>
ServerName dev.xxxxxx.com
# This is for websocket requests
ProxyPass /ws ws://localhost:8090/
ProxyPassReverse /ws ws://localhost:8090/
ProxyPass /wss wss://localhost:8090/
ProxyPassReverse /wss wss://localhost:8090/
DocumentRoot /var/www/dev.xxxxxx.com/public/
<Directory /var/www/dev.xxxxxx.com/public/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]   
</VirtualHost>

test.xxxxxx.com.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>

dev.xxxxxx.com.htaccess

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]

错误日志

[Thu Oct 08 06:25:03.080835 2020] [mpm_prefork:notice] [pid 7166] AH00163 Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Thu Oct 08 06:25:03.080868 2020] [core:notice] [pid 7166] AH00094: Command line: '/usr/sbin/apache2'
[Thu Oct 08 06:58:55.476022 2020] [mpm_prefork:notice] [pid 7166] AH00169: caught SIGTERM, shutting down
[Thu Oct 08 06:58:55.591321 2020] [mpm_prefork:notice] [pid 27165] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Thu Oct 08 06:58:55.591392 2020] [core:notice] [pid 27165] AH00094: Command line: '/usr/sbin/apache2'
[Thu Oct 08 07:45:13.216293 2020] [mpm_prefork:notice] [pid 27165] AH00169: caught SIGTERM, shutting down
[Thu Oct 08 07:45:13.333468 2020] [mpm_prefork:notice] [pid 7532] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Thu Oct 08 07:45:13.333534 2020] [core:notice] [pid 7532] AH00094: Command line: '/usr/sbin/apache2'
[Thu Oct 08 07:48:35.893704 2020] [mpm_prefork:notice] [pid 7532] AH00169: caught SIGTERM, shutting down
[Thu Oct 08 07:48:36.048994 2020] [mpm_prefork:notice] [pid 9434] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Thu Oct 08 07:48:36.049053 2020] [core:notice] [pid 9434] AH00094: Command line: '/usr/sbin/apache2'
[Thu Oct 08 07:49:01.736094 2020] [mpm_prefork:notice] [pid 9434] AH00169: caught SIGTERM, shutting down
[Thu Oct 08 07:49:01.965885 2020] [mpm_prefork:notice] [pid 9836] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Thu Oct 08 07:49:01.965966 2020] [core:notice] [pid 9836] AH00094: Command line: '/usr/sbin/apache2'

我启用了这两个站点并重新启动apache2,但开发程序不起作用。有人吗?

原来在C:WindowsSystem32driversetc中的hosts文件中设置了一个具有相同域dev.xxxxxx.com的本地主机,我将其从hosts文件中删除,它运行顺利。

最新更新