我正在运行一个 EC2 实例,其中 Nginx 配置为从特定目录提供静态文件。当我通过端口 4000 上的 HTTP 访问文件时,一切正常。但是,当我尝试访问时...
我正在运行一个 EC2 实例,其中 Nginx 配置为从特定目录提供静态文件。当我通过端口 4000 上的 HTTP 访问文件时,一切正常。但是,当我尝试通过 HTTPS 访问相同的文件时,我收到 403 Forbidden 错误。
以下是我目前所做的:
p3
server { server_name server.avandraapp.com; root /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public; location / { try_files $uri $uri/ =404; } # Add Content-Security-Policy header add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization'; location /uploads/ { alias /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public/uploads; autoindex on; allow all; } location /api { rewrite ^\/api\/(.*)$ /api/$1 break; proxy_pass http://localhost:4000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/server.avandraapp.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/server.avandraapp.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = server.avandraapp.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name server.avandraapp.com;
return 404; # managed by Certbot
}
sudo chown -R www-data:www-data /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public/uploads
sudo chmod -R 755 /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public/uploads
sudo chmod +x /home/ubuntu/actions-runner-backendserver/_work
sudo chmod +x /home/ubuntu/actions-runner-backendserver/_work/tripai-backend
sudo chmod +x /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend
sudo chmod +x /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public
sudo chmod +x /home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public/uploads
[error] 53511#53511: *3 open() "/home/ubuntu/actions-runner-backendserver/_work/tripai-backend/tripai-backend/public/uploads/destination/image/image-1714166321743-183488313.jpg" failed (13: Permission denied), client: 94.187.19.52, server: server.avandraapp.com, request: "GET /uploads/destination/image/image-1714166321743-183488313.jpg HTTP/1.1", host: "ec2-13-53-111-155.eu-north-1.compute.amazonaws.com"
我不知道如何修复 HTTPS 访问的 403 Forbidden 错误。如能提供任何指导或建议,我将不胜感激!
我已经全局安装了 solc@0.8.26,但最近的一个项目需要使用 solc@0.8.20。我已经在本地项目文件夹 (/node_modules/.bin/solcjs) 中安装了 solc@0.8.20。但是当我尝试 \'solc --
我已经全局安装了 [email protected] ,但最近的一个项目需要使用 [email protected] 。我已经在本地项目文件夹 (/node_modules/.bin/solcjs) 中安装了 [email protected] 。但是当我在本地项目文件夹中尝试 \'solc --version\' 时,我仍然得到 \'Version: 0.8.26+commit.8a97fa7a.Linux.g++\'。
如何确保在项目文件夹中,每当我运行“solc”时,它都会使用本地安装的版本?
感谢您的时间。