Serving static files with NGINX

  Рет қаралды 43,064

Juriy Bura

Juriy Bura

Күн бұрын

Пікірлер: 34
@JuriyBura
@JuriyBura 6 жыл бұрын
IMPORTANT ------------------ From 2018 and on, the setup in this video will only work if your SELinux is configured correctly (to allow nginx to connect to Node and to read files from home folder). Otherwise you will be getting "Not Found" and "Permission Denied" errors. Check out this video if that's what you are experiencing: kzbin.info/www/bejne/fpnclYGqlrF4gZI
@umeshdhaked7638
@umeshdhaked7638 5 жыл бұрын
this type of how to videos are now my new fantasies . :)
@khalidelgazzar
@khalidelgazzar Жыл бұрын
Great video. You're showing great details in both nginx & node.js .. thabk you!
@airxperimentboom
@airxperimentboom 4 жыл бұрын
YOU SAVED MY ASS BUDDY. It's been 3 days I was unable to run my nginx server on docker because of right management that's sick !
@JuriyBura
@JuriyBura 4 жыл бұрын
Eelke Johnson glad it helped! :)
@kencharles7048
@kencharles7048 7 жыл бұрын
Exactly what I was looking for, and worked perfectly. Thanks!
@chill-hot-stream
@chill-hot-stream Жыл бұрын
Hey there it also helped me deploy my Django application
@jayaganthan1
@jayaganthan1 5 жыл бұрын
Can't thank you enough man. Great Video!
@chill-hot-stream
@chill-hot-stream Жыл бұрын
Thanks Jury you saved me today thanks I like your videos
@rhuzaifa
@rhuzaifa 2 жыл бұрын
This saved me a ton of time. Thanks
@1011ph
@1011ph 6 жыл бұрын
This is really really good. Thanks very much!! I encountered the permission issue and tried nginx_conf/user/group/selinux/ all not working finally with your "namei" command found one folder did not give 'x' permission. It works now. :)
@glkoop
@glkoop Жыл бұрын
I have a noob quetion, so in the case here our nginx would be storing the files ? if I am dockerized and my Nginx is a seperate docker/phisical-server then files host on that server ?
@kp_beta
@kp_beta 4 жыл бұрын
Great video, can you help me with some tip? i have multiples locations where each on have a nodejs application, so i need setup multiples statics path
@forbitbd3348
@forbitbd3348 4 жыл бұрын
chown: invalid group: ‘sohel:nginx’ . Here sohel is my user
@diegor5805
@diegor5805 4 жыл бұрын
What is the benefit of serving static files using nginx? What if I wanted to serve the home route using express, but still serve other static files using nginx?
@Jendrus12
@Jendrus12 3 жыл бұрын
Speed!
@ПетроКобзар
@ПетроКобзар 6 жыл бұрын
Я так понимаю нужно все запросы в node делать /api/some_req Тоесть я не могу тепер делать /some_req. Иначе он попадет к nginx. А тот его не обработает?
@FirstLast-hm8oz
@FirstLast-hm8oz 3 жыл бұрын
Sorry, I cannot reach the static page even if I start an independant server listening on 8080. The error is always 404.
@alinajafi8824
@alinajafi8824 Жыл бұрын
That’s great work me.
@smartliga8623
@smartliga8623 6 жыл бұрын
Juriy need your help. How to serve dynamic index.html on rout "/" if nginx grabs this and try to give static file first.
@smartliga8623
@smartliga8623 6 жыл бұрын
How to serve dynamic index with static css in public folder. Index.html is not in public folder its dynamic. That's the question.
@JuriyBura
@JuriyBura 6 жыл бұрын
I don't quite get your setup. So your index.html is not there, since it is served by node.js? And what's nginx then serving?
@smartliga8623
@smartliga8623 6 жыл бұрын
I working on a new project now and it seems it's working fine now. I believe it was my mistake. Thank You for such awesome content
@anandsingh1011
@anandsingh1011 5 жыл бұрын
Thanks you very much this ..
@JohnSmith-ud9fi
@JohnSmith-ud9fi 6 жыл бұрын
I had one problem while following your tutorial. The thing is that you must also do: "chmod -R g+x /path/to/public/folder" and/or "chmod -R u+x /path/to/public/folder" to enable executing of this files. Because if your user (which is defined in nginx "user" directory nginx.org/en/docs/ngx_core_module.html#user ) won't have the rights to execute the files in your public folder it won't work.
@JuriyBura
@JuriyBura 6 жыл бұрын
Why would you want to "execute" files in the public folder? You have only to be able to "read" them. X is required to "cd" into the folder, which we did for user's home directory.
@darwinmendez8206
@darwinmendez8206 5 жыл бұрын
why you put there api/test?,
@JuriyBura
@JuriyBura 5 жыл бұрын
To simulate some kind of API that is available under that route.
@saltzliu
@saltzliu 7 жыл бұрын
Very good tutorial
@trueduePL
@trueduePL 7 жыл бұрын
in my fedora it doesn't work. When I set correct permissions I was still getting NOT PERMITED. I had to also disabled my SELinux in nano /etc/selinux/config SELINUX=disabled and now works good. thanks for video :)
@TekSchool
@TekSchool 6 жыл бұрын
I run into the same issue. Disabling SELinux worked, but it didn't feel right. Why did we have to go through configuring SELinux in the first place? The answer was that I needed to set: chcon -Rt httpd_sys_content_t /home/USERNAME/easyio/public as indicated in the video about Understanding and Configuring SELinux.
@joakimjohansson7729
@joakimjohansson7729 6 жыл бұрын
Love it! :D
@postal774
@postal774 6 жыл бұрын
Русский)
@AlexeyZubkov
@AlexeyZubkov 5 жыл бұрын
Сертификат обнови дядя
How to get free SSL certificate and configure HTTPS
16:26
Juriy Bura
Рет қаралды 80 М.
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 29 МЛН
Installing and Configuring NGINX on CentOS
11:01
Juriy Bura
Рет қаралды 86 М.
Load Balancing with NGINX
14:35
Juriy Bura
Рет қаралды 84 М.
Apache vs NGINX
7:53
IBM Technology
Рет қаралды 311 М.
Understanding Network Interfaces
15:45
Juriy Bura
Рет қаралды 61 М.
NGINX Fundamentals - Creating a Virtual Host
4:57
Stackacademy.tv
Рет қаралды 36 М.
Setting Up the Perfect Developer Environment on Linux for 2025
11:58
Using NGINX Open Source for Video Streaming and Storage
14:11
Nginx | Environment Variables | envsubst
8:45
Very Academy
Рет қаралды 8 М.
Nginx: настройка директивы location
11:59
Поддержка Сайтов :: Метод Лаб
Рет қаралды 21 М.
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН