亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在我的 Rpi 上加載資源時出現 SSL 問題

在我的 Rpi 上加載資源時出現 SSL 問題

C#
烙印99 2023-08-20 10:04:23
我在 Raspbian 上使用 Asp.Net Core。我使用 NGINX 作為我的網絡服務器我嘗試加載資源并連接到我的 Web api 控制器問題是我的 uri 正在從 http 更改為 https。由于我想在網絡上的其他地方瀏覽該網站,因此我能實現的目標非常有限。如果我在 Pi 本身上并使用 localhost 或 127.0.0.1,則一切加載正常。如果我使用 dhcp 地址訪問它,則會失敗。它之所以有效,是因為我使用的是 Open SSL,但僅限于本地級別。這是我的 NGINX:server {listen 80 default_server;listen [::]:80 default_server;# SSL configuration## listen 443 ssl default_server;# listen [::]:443 ssl default_server;## Note: You should disable gzip for SSL traffic.# See: https://bugs.debian.org/773332## Read up on ssl_ciphers to ensure a secure configuration.# See: https://bugs.debian.org/765782## Self signed certs generated by the ssl-cert package# Don't use them in a production server!## include snippets/snakeoil.conf;    listen               443;    ssl                  on;    ssl_certificate      /home/pi/web/localhost.crt;    ssl_certificate_key  /home/pi/web/localhost.key;    ssl_ciphers          HIGH:!aNULL:!MD5;root /var/www/html;# Add index.php to the list if you are using PHPindex index.html index.htm index.nginx-debian.html;server_name _;location /FindMotion/ {        proxy_pass http://localhost:5000/;        proxy_http_version 1.1;        proxy_set_header Connection keep-alive;        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;        proxy_set_header X-Forwarded-Host   $http_host;        proxy_set_header X-Forwarded-Proto  http;        proxy_set_header X-Forwarded-Path   /FindMotion;}}瀏覽控制臺中的錯誤是: https://192.168.0.12/Connection/ImageData 404(未找到)我是否正確地認為這無法工作,因為 Open SSL 不夠?如果是這樣,我認為我必須獲得“適當的”SSL 并且為此需要一個域名,這是否也是正確的?如果是這樣的話,對于我銷售/生產的每一種產品,我都需要一個域名和靜態地址嗎?我的理解完全錯誤還是完全正確?請問我有什么選擇?在過去的幾天里我嘗試了很多事情,但沒有任何效果。我非常需要建議。
查看完整描述

1 回答

?
蕭十郎

TA貢獻1815條經驗 獲得超13個贊

我認為這更有可能是 nginx 配置問題。404 not found 表示 403 上沒有任何內容。并不是說 TSL 版本或 SSL 版本不適合您。您可能會從 nginx 收到 400(錯誤請求)或 495(SSL 錯誤)。


像這樣嘗試一下。對此我不確定。但我從未見過 http 和 https 在同一個塊中配置?,F在我不是系統管理員,離它還很遠,但我自己的服務器的設置更像是這樣。我還在其中放置了一行 ssl_protocols 來指定基本上所有這些協議。也許這有幫助。但正如我所說,當您返回 404 時,我認為這不會是 TLS 或 SSL 問題。


server {

listen 80 default_server;

listen [::]:80 default_server;

return 301 https://192.168.0.12$request_uri;

}


server {

    listen               443;

    ssl                  on;

    ssl_certificate      /home/pi/web/localhost.crt;

    ssl_certificate_key  /home/pi/web/localhost.key;

    ssl_ciphers          HIGH:!aNULL:!MD5;

    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;


root /var/www/html;


# Add index.php to the list if you are using PHP

index index.html index.htm index.nginx-debian.html;


server_name _;



location /FindMotion/ {

        proxy_pass http://localhost:5000/;

        proxy_http_version 1.1;

        proxy_set_header Connection keep-alive;

        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Host   $http_host;

        proxy_set_header X-Forwarded-Proto  http;

        proxy_set_header X-Forwarded-Path   /FindMotion;

}

}

}


查看完整回答
反對 回復 2023-08-20
  • 1 回答
  • 0 關注
  • 130 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號