小编Ghu*_*han的帖子

如何使用反向代理在 Nginx 中处理应用程序级别重定向

我正在为基于 Crystal-Lang 的应用程序编写 Nginx 配置,以通过反向代理http://example.com/videos/发送所有流量。http://0.0.0.0:3000

我已经编写了以下配置,该配置不起作用,我正在互联网上但没有运气。

当我转到 时,应用程序在内部执行从问题所在的http://example.com/videos/重定向,它重定向到错误的位置,我需要像往常一样始终将部分与 URL 连接起来,但在重定向后,该部分将被切掉。所以应用程序应该考虑作为主机。http://example.com/http://example.com/feed/popularhttp://example.com/feed/popular/videos/http://example.com/videos/xxxx/videos/http://example.com/videos/

这是我的配置:

server {
    listen 80;
    server_name elearn.com.pk default_server localhost;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    location /videos/ {
        proxy_pass http://0.0.0.0:3000/;
        proxy_http_version 1.1;
        rewrite /videos/(.*) /$1 break;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host/videos/;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
   }
}
Run Code Online (Sandbox Code Playgroud)

有人可以帮我解决这个问题吗?谢谢。

nginx crystal-lang alpine-linux

6
推荐指数
1
解决办法
3724
查看次数

C#在asp.net应用程序中获取当前的纬度和经度

我正在开发一个应用程序,它将检测用户位置显示的纬度和经度,并显示针对它们的物理地址。当我运行它时,我什么也没得到。

我的系统位置已打开,并且具有有效的Internet连接。我每次在任务栏中看到有人跟踪位置的点时,仍然看不到任何东西。

这是我的代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Device.Location;
using System.Diagnostics;
namespace APIsProject
{
public partial class GetLatitudeandLongitude : System.Web.UI.Page
{
    private string latitude;
    private string longitute;
    private GeoCoordinateWatcher watcher = new GeoCoordinateWatcher();
    protected void Page_Load(object sender, EventArgs e)
    {
        GeoCoordinateWatcher watcher = new GeoCoordinateWatcher();
        watcher = new GeoCoordinateWatcher();
        // Catch the StatusChanged event.  
        watcher.StatusChanged += Watcher_StatusChanged;
        // Start the watcher.  
        watcher.Start();

    }

    private void Watcher_StatusChanged(object sender, 
    GeoPositionStatusChangedEventArgs e) // Find GeoLocation …
Run Code Online (Sandbox Code Playgroud)

c# asp.net

0
推荐指数
1
解决办法
6996
查看次数

标签 统计

alpine-linux ×1

asp.net ×1

c# ×1

crystal-lang ×1

nginx ×1