Home > git > nginx git folder request

nginx git folder request

January 10Hits:6

Im using nginx and git-web and it works great. I access my site using www.mydomain.org to pull up gitweb. Here is my config file:

server {     listen 80 default_server;     listen [::]:80 default_server;     server_name www.mydomain.org;     return 301 https://$server_name$request_uri; }  server {     listen 443 ssl;     server_name www.mydomain.org;      ssl on;     ssl_certificate /etc/nginx/ssl/mydomain_org/www_mydomain_org.crt;     ssl_certificate_key /etc/nginx/ssl/mydomain_org/www_mydomain_org.key;     ssl_session_timeout 5m;     #enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;      #Disables all weak ciphers     ssl_ciphers "Cut it out cause it was very long in question";     ssl_prefer_server_ciphers on;      root /var/www/html;      auth_basic           "Restricted";     auth_basic_user_file git_access_list;      location /html {         root /var/www;         index index.html;         access_log off;         expires max;     }      # static repo files for cloning over https     location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx))$ {         root /media/drive1/gitrepo/;     }      # requests that need to go to git-http-backend     location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ {         root /media/drive1/gitrepo;          fastcgi_pass unix:/var/run/fcgiwrap.socket;         fastcgi_param SCRIPT_FILENAME   /usr/lib/git-core/git-http-backend;         fastcgi_param PATH_INFO         $uri;         fastcgi_param GIT_PROJECT_ROOT  /media/drive1/gitrepo;         fastcgi_param GIT_HTTP_EXPORT_ALL "";         fastcgi_param REMOTE_USER $remote_user;         include fastcgi_params;     }      # send anything else to gitweb if it's not a real file     try_files $uri @gitweb;     location @gitweb {         fastcgi_pass unix:/var/run/fcgiwrap.socket;         fastcgi_param SCRIPT_FILENAME   /usr/share/gitweb/gitweb.cgi;         fastcgi_param PATH_INFO         $uri;         fastcgi_param GITWEB_CONFIG     /etc/gitweb.conf;         include fastcgi_params;     }      location /index.cgi {         root /usr/share/gitweb;         include fastcgi_params;         gzip off;         fastcgi_param SCRIPT_NAME $uri;         fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;         fastcgi_pass unix:/var/run/fcgiwrap.socket;     }      location / {         root /usr/share/gitweb/;         index index.cgi;     }      error_page 500 502 503 504 /50x.html;     location = /50x.html {         root html;     } } 

What I would like to do is have a git sub folder instead ex: www.mydomain.org/git to pull up gitweb main page. Im not quite sure how to change it and kinda stuck. Any advise or tips on how to accomplish this?


Related Articles

  • nginx git folder requestJanuary 10

    Im using nginx and git-web and it works great. I access my site using www.mydomain.org to pull up gitweb. Here is my config file: server { listen 80 default_server; listen [::]:80 default_server; server_name www.mydomain.org; return 301 https://$serv

  • Nginx redirect all requests trying to reach a folderDecember 30

    How can I redirect all requests trying to reach a folder? for example, I would like to redirect: somedomain.com/folder/subfolder/index.html somedomain.com/folder/subfolder2/something.html somedomain.com/folder/subfolder3/somethingelse.html to somedom

  • Apache and Nginx - Forwarding .htaccess requests to Apache?December 3

    A really simple one but it's alluding me entirely. I've set up nginx as a proxy for Apache and at the moment it's only set to allow requests for certain files through to Apache, the config line is below. Problem I'm having, I need it to send .htacces

  • centos 5 + nginx + git-http-backendFebruary 21

    I've a CentOS 5 server at domain.fr. I'm trying to set a subdomain so that I can use it with git, "git.domain.fr". My repositories are in /home/git (example /home/git/repos.git). I've installed git-http-backend and nginx. I've set a repository l

  • NGINX + Git push = 403March 8

    I have Git repo on remote box, configured with NGINX + uWSGI. Nginx compiled with: # nginx -V nginx version: nginx/1.6.2 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) configure arguments: --with-http_dav_module --add-module=nginx-dav-ext-modul

  • Nginx redirect folder to subdomainJune 5

    I'm trying to configure a redirect on Nginx from a folder to a subdomain. I've tried already Nginx redirect: folder to external domain and Nginx rewrite rule (subdirectory to subdomain) and nginx: redirect subfolder to subdomain. Nothing works. The p

  • Recover shift-deleted .hg or .git folder and its content in Windows 7June 28

    I've tried using Recuva, Undelete Plus, and some other tools. But it seems these tools are unable to find the content stored in .hg or .git folder, I can only recover .hgignore or .gitignore files. Does this have anything to do with NTFS? Is there an

  • Nginx, awstats and request time

    Nginx, awstats and request timeOctober 4

    How can I tune nginx to write request time to logs such that awstats can show time taken for each request? Also, how can I see requests by time taken in awstats? This is the current format log_format main '$remote_addr - $remote_user [$time_local] "$

  • What to do with .git folder and data in Xcode?October 25

    I am using Hg for my development. Recently, I upgraded to Lion and Xcode 4.2 and I have created a Xcode project in my source tree. The Xcode by default uses Git and created .git folder in the project folder. Being able to do versioning in Xcode is a

  • Nginx Retry of Requests ( Nginx - Haproxy Combination )March 11

    I wanted to ask about Nginx Retry of Requests. I have a Nginx running at the backend which then sends the requests to HaProxy which then passes it on the web server and the request is processed. I am reloading my Haproxy config dynamically to provide

  • cannot write to nginx www folderApril 29

    I've recently installed nginx on my dev machine with Ubuntu 12.04. I am currently logged in as myuser and after installing nginx I setup the following file permissions (nginx www folder was owned by root so I wanted to change that so I can edit files

  • Nginx forward all requests to another domainOctober 24

    I have been struggling to get this whole setup to work. I've found bits and pieces on the net but nothing that solves all of my requirements. I need to do this to make IE8 work, so unfortunately my hands are tied a little. I can move some endpoints a

  • How to take backup of nginx cache folder along with metadata?July 8

    I want to take a backup of nginx cache folder ( the proxy_cache_path ) and its metadata of the main server and use that as the cache folder of a secondary server. This is so that if the main server goes down the secondary server can take its place an

  • How do I tell Nginx to pass requests to different apps based on the incoming url?February 8

    How do I tell Nginx to pass requests to different apps based on the incoming url? For example, mybudgetapp.com and myshoppingapp.com both point to my server where both apps (8001, 8002) and Nginx (80) are running. When a user goes to mybudgetapp.com

  • Giving PHP the permission to make a git pull requestMarch 27

    I would like to allow PHP to execute a Git pull command. But there are some problems with the user and permissions. How did you solve the problem? PHP runs as user www-data. Therefore I've changed the .git directory owner/group to www-data (chown www

  • Howto Nginx + git-http-backend + fcgiwrap (Debian Squeeze)November 23

    I am trying to setup git-http-backend with Nginx but after 24 hours wasting time and reading everything I could I think this config should work but doesn't. server { listen 80; server_name mydevserver; access_log /var/log/nginx/dev.access.log; error_

  • How do I make nginx's folder moveable?August 27

    Currently when I compile nginx (in directory /home/parth/nginx), it embeds the prefix supplied to configure script in the nginx binary. Now when I move that folder around (let's say to /tmp), it breaks with following error message. Is there a way to

  • Nginx, check for request method without using IF?October 3

    I am trying to optimize my Nginx config but ran into an issue I don't know how to fix. I have a folder /images on my server from which I deliver various static files for a website. The same folder though is also used in order to upload files via WebD

  • Nginx complete folder protection not workingOctober 19

    I have installed nginx(1.4.3) with PHP-FPM(5.4.20). i want to protect my wordpress wp-admin folder. my nginx configuration file domain.conf: server { listen 80; server_name example.com; root /var/www; location / { index index.php; try_files $uri $uri

  • nginx: Redirect all requests to a proxy, but not these three specific URLsAugust 4

    nginx can be tricky sometimes: I want to redirect all incoming requests for www.sub.domain.com/* to www.other.domain.com/* use a proxy so users still see the original www.sub.domain.com when browsing the site add an exception for specific URLs (all t

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.495 s.