I'm not so good with nginx but i try to make somthing with that and fresh installed gitlab.
So i intall on digitalocean Gitlab. One click installer (ubuntu 13.10). But now i try to install php and phpmyadmin and after that i want to make somthing ridiculous. I want move main repository map from /home/gitlab/gitlab-satellites to main root of my dev (same server).
So gitlab need to be on my_domain.com/gitlab, and main dev server location will be my_domain.com.
Is this possible or?
you can find the nginx conf files in the gitlab installation: gitlab/nginx/etc
which will be '/var/opt/gitlab/nginx/etc' in the default install
you can then edit the .conf files as necessary
Example on the 'gitlab-http.conf' file you will find:
server {
listen *:80;
server_name git.your-domain-name.com;
you will have to create similar virtual hosts on NGINX for
server {
listen *:80;
server_name your-domain-name.com;
OR
server {
listen *:80;
server_name *.your-domain-name.com;
Related
I'll try to be short as it can get bloated.
I set up an ubuntu server 20.04 VM on an Oracle vbox.
I installed nginx, php7.4, Xdebug 3.
I configured everything properly for remote debugging and sftp ( I use PHPstorm), I forwarded the ports and customized my local hosts file.Everything works except...
when loading HTTP://127.0.0.2 it loads the default nginx landing page.My index.php file is uploaded in the root /var/www/my_domain folder through sftp. I created the server block for my_domain.
Still won't work. I am new to this so I am missing something.
If you need more info please request.
Any help appreciated!
Vhost config ( server block in nginx) - php-projects being my current domain and containing index.php:
server {
listen 80;
listen [::]:80 ipv6only=on;
root /var/www/php-projects;
server_name php-projects www.php-projects;
location / {
try_files $uri $uri/ =404;
}
error_log /var/log/nginx/debug.log debug;
}
Network settings from Vbox:
PS. I have tried :
How to set index.html as root file in Nginx?
and
Rewrite rule for the root file in nginx?
with no success.
"I configured everything properly for remote debugging and sftp"
Please post your xdebug configuration.
"when loading HTTP://127.0.0.2"
From where ? Host machine or VM?
"My index.php file is uploaded in the root /var/www/my_domain folder
through sftp."
Please post your nginx vhost configuration
"I created the server block for my_domain"
Where? Post the path to the file where you have done this
I am trying to migrated my application in ebs because it was deprecated, my previous platform was:
PHP 5.6 running on 64bit Amazon Linux / 2.9.8
now i'm migrating to:
PHP 7.4 running on 64bit Amazon Linux 2 / 3.0.3
This platform uses the Nginx server instead of Apache.
I was able to deploy my application but the problem is that my .htaccess configuration file was deprecated as was my .ebextensions configuration file. so I have lost the settings I had for example to get clean urls and redirects from http to https.
I have tried to transform the apache configurations to Nginx by putting the respective configuration file but apparently they have no effect.
I have tried many test configurations and I have come to the conclusion that the platform is not reading the configurations that I put.
I have tried to try for example with this little configuration, which should allow me to list the "views" directory:
cleanurl.config
server {
location / views / {
autoindex on;
}
}
I have tried putting it in the following folders.
".ebextensions / cleanurl.config"
files:
"/etc/nginx/conf.d/cleanurl.conf":
mode: "000644"
owner: root
group: root
content: |
server {
location / views / {
autoindex on;
}
}
".platform / nginx / conf.d / cleanurl.config"
server {
location / views / {
autoindex on;
}
}
But I don't get results. I always get 403 Forbidden when I point to a folder. Please help.
Thanks in advance
After trying and trying I was able to solve it in the following way:
I put the file in this location
.platform/nginx/conf.d/elasticbeanstalk/cleanurl.conf
change my config file like this
location/views/ {
autoindex on;
}
and now everything works.
I have tried many test configurations and I have come to the conclusion that the platform is not reading the configurations that I put.
In the first case this is because the configuration files that you use are for Amazon Linux 1 (AL1). However, you environment is PHP 7.4 running on 64bit Amazon Linux 2 (AL2).
In your second attempt, you are using the config files in .platform/nginx/conf.d/ as you should. However, you are using *.config extension. This wrong extension and it should be:
cleanurl.conf
You still may have other issues, but the wrong extension could explain why the files are being ignored.
I have a three php-fpm servers, and a one nginx server, where I want to loadbalance php-fpm using nginx server.
php-fpm server1 - 192.168.10.31
php-fpm server2 - 192.168.10.32
php-fpm server3 - 192.168.10.33
nginx - server - 192.168.10.12
My Configuration on nginx server was;
upstream php_backend {
server 192.168.10.31:9000;
server 192.168.10.32:9000;
server 192.168.10.33:9000;
}
location ~ \.php$ {
fastcgi_pass php_backend;
}
But my problem is, where should I define the webroot [ root /path/to/webfiles ]
Because on nginx server [ 192.168.10.12 ], access log says file not found - 404. Where should I keep website php files? On nginx server or php servers? or in both nginx and php servers?
This is kind of an old question, but I'll give my answer here for anyone googling this.
Robbie Averill's comment is correct. You should host your files both on Nginx and PHP servers. You can do this with an NFS share, but this might slow things down.
To work around this you could update your code on the nginx server and then rsync to the php servers.
You could easily build a bash script that does something like:
rsync -avzp -e ssh /srv/www/ svc_internal#php.insypro.com:/srv/www/
rsync -avzp -e ssh /srv/www/ svc_internal#php2.insypro.com:/srv/www/
rsync -avzp -e ssh /srv/www/ svc_internal#php3.insypro.com:/srv/www/
Of course, you'd want to include this in one bash script that does the updating of your code, and synchronises the php machines.
I just create a server recently, and use Nginx as my web server.
I did : service nginx force-reload
Reloading nginx configuration nginx [ OK ]
Then I do service nginx status
nginx is running
Knowing that my site is running, but when I go to it. I see No input file specified. Wired ???
Here is what I have in my /etc/nginx/sites-available/default
server {
listen 80 default_server;
server_name default;
root /default/public;
Can someone please help me fix this ?
I fix this problem by assign my document root to the correct path :
root /home/forge/default/public;
If you see No input file specified., make sure you set your root to the correct path.
I have created a fresh Laravel application by using composer create-project command. Then I put all the folders and files in /usr/share/nginx/html/, which is the default document root for my nginx server. However everytime I runs the http://localhost, it keeps displaying 403 Forbiden. I tried creating a testing index.php (<? php_info();) and it worked fine.
I've read somewhere that I need to set the containing folder (/html), as well as the app/storage folder permission to 777 but still no luck.
Please help me. Thank you in advance.
Here is the nginx default.conf
Laravel projects serve from the <projectName>/public directory. Make sure your nginx config is set up to look there for your index file and NOT in your <projectName> folder only.
Would you edit your question and paste your server config there?
I think it may because index.php is not in the index file list. check these lines:
index index.html index.php;
or
try_files $uri $uri/ =404;
The accepted answer is correct - Laravel services from the public folder and you need to tell nginx to look there - but also a little vague if you're bumping up against this problem. When you create new sites on a Homestead installation by adding them to your .yaml file and using vagrant provision or vagrant up --provision, the created nginx conf file will need editing before Laravel will serve files correctly.
Go to your CLI, and enter Homestead using vagrant ssh or homestead ssh. It will ask for your password, which by default is "vagrant".
Once you're in the virtual machine, type the following commands:
sudo nano /etc/nginx/sites-enabled/your-site-name-here
Then add /public to the end of the existing root near the top of the file (it'll be something like /home/vagrant/projects/your-site to begin with and save in Nano (ctrl+s), then exit nano (ctrl+x).
Once you've exited Nano, restart nginx using sudo nginx -s reload. Your routing will now work!