nginx-location

    0熱度

    2回答

    我在centos上運行nginx 6.域配置爲使用ssl。某些特定的文件夾需要密碼保護。如果我用http輸入url,那麼基本的瀏覽器會要求輸入用戶並通過。如果我用https輸入相同的URL,那麼將顯示特定文件夾的索引文件而不要求用戶通過。 我有這個在我的特定領域nginx.conf文件: location /protected_folder { auth_basic "Restrict

    1熱度

    1回答

    如何重定向以「/ admin」開頭url重定向到/admin/index.html(單頁面應用),另一個頁面重定向到/index.html(其他單頁面應用) 。 我的nginx.conf在這裏 location/{ if ($allowed = "deny") { return 403; } try_files $uri /index.html; } location /

    0熱度

    1回答

    我試圖排除來自HTTP認證(在Drupal Brightcove的視頻上傳修復)一些文件,但我的nginx的配置無法正常工作: location/{ auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; location ~* \.(3g2|3gp|asf|avi|dv|flv|f4v|m4v|mov|mp4

    0熱度

    1回答

    我想製作一個小腳本,允許從一臺服務器上傳多個文件到另一臺服務器。問題是當我添加超過100個URL時,它會破壞文件。 任何方法使它更乾淨,所以文件不應該損壞。 下面是腳本: // Check if form has been submitted if(@$_POST['submit']){ ini_set("max_execution_time", 0); // no time-outs! i

    0熱度

    1回答

    我有這樣的URL列表: domain.com/some-url-key-with-possible-id-after-it-99999.html 我需要嘗試的URL,如果返回404重定向到: domain.com/some-url-key-with-possible-id-after-it.html 是這樣可能? location ~ /([a-zA-Z0-9\-]+)-([0-9]+).

    0熱度

    1回答

    我想操縱一個nginx變量。 我有一個變量名稱$ user,其中包含一個UPN like [email protected] 我想設置另一個變量$ xuser;成爲$ user減去@domain - 即某人。 這是在一個位置塊,所以我不認爲我可以使用地圖。 我已經試過這一點,但$ XUSER似乎從來就沒設置: if ($user ~* "(?<p>[aa-zZ]+)@example.com")

    0熱度

    2回答

    我有一個很簡單的虛擬主機的配置: server { listen 80 default_server; server_name datavis.dev.localserver.fr; root /var/www; location ~ ^\/datavis\/(?<datarep>[\w]+) { alias /var/www/data-${

    0熱度

    1回答

    我是新來的網站開發,所以如果這是一個簡單的問題,我很抱歉。我有一個正確的nginx反向代理設置,並試圖在我的index.htm頁面上創建一個鏈接,將我帶到反向代理站點。 所以,如果我的網站是「website.com」我想將我的nginx的/測試位置爲「website.com/test。如果我有HREF爲‘website.com/test’它會帶我去但正確的頁面不顯示的區別在瀏覽器地址。 因爲我是新

    0熱度

    1回答

    我有一個反向代理nginx的與在nginx.config以下運行: http { lua_package_path ";;$prefix/?.lua;?.lua;/etc/nginx/?.lua;/etc/nginx/resty/?.lua;"; } ,然後多個位置,在服務器: # xxx SERVICE location ~* ^/articles/?(.*) {

    1熱度

    1回答

    我有一個反向的nginx代理我想要的路線,與進來的所有請求: http://dns.com/content/xyz <—to—> http://dns.com/content/1.0/xyz 我具有上游: upstream backend_api.content.com { server localhost:8080 max_fails=5 fail_timeout=30;