我在laravel中有一个在远程服务器(数字海洋)上运行的应用程序,我已经从服务器创建了快照,然后从快照创建了另一个Droplet。更改了Ngnix conf文件,以在URL地址和更新的.env文件之前添加一个阶段。
我可以为我的应用程序运行api和管理器,但是www站点始终返回/ 500网址。是否存在有关克隆服务器和更改URL的分步指南?
---编辑----- 浏览器显示的错误是:
homologacao.mysite.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
这是我的ngnix conf文件。
server {
listen 80;
server_name www.homologacao.mysite.com www.homologacao.mysite.com.br homologacao.mysite.com.br homologacao.mysite.com default_server;
root /usr/share/nginx/html/mysite.com/www;
index index.html index.htm;
location ~/.well-known {
allow all;
}
client_max_body_size 250m;
access_log /usr/share/nginx/html/mysite.com/logs/nginx.www.access.log;
error_log /usr/share/nginx/html/mysite.com/logs/nginx.www.error.log error;
charset utf-8;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
# add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:5003;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
# API
server {
listen 80;
root /usr/share/nginx/html/mysite.com/api/current/public;
client_max_body_size 250m;
server_name apihml.mysite.com;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
# add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
location ~ /.well-known {
allow all;
}
access_log /usr/share/nginx/html/mysite.com/logs/api.nginx.access.log;
error_log /usr/share/nginx/html/mysite.com/logs/api.nginx.error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
charset utf-8;
index index.html index.htm index.php;
#include /etc/nginx/default.d/*.conf;
error_page 500 502 503 504 /50x.html;
error_page 404 /404.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass deployer-php-fpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
location / {
chunked_transfer_encoding on;
try_files $uri $uri/ /index.php?$query_string;
}
}
# MANAGER
server {
listen 80;
server_name managerhml.mysite.com;
client_max_body_size 200m;
root /usr/share/nginx/html/mysite.com/manager/public;
access_log /usr/share/nginx/html/mysite.com/logs/manager.nginx.access.log;
error_log /usr/share/nginx/html/mysite.com/logs/manager.nginx.error.log;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
location ~/.well-known {
allow all;
}
}