[Support] Linuxserver.io - Nginx


Recommended Posts

linuxserver_medium.png

 

Application Name: Nginx

Application Site: https://www.nginx.com/

Docker Hub: https://hub.docker.com/r/linuxserver/nginx/

Github: https://github.com/linuxserver/docker-nginx

 

Please post any questions/issues relating to this docker you have in this thread.

 

If you are not using Unraid (and you should be!) then please do not post here, instead head to linuxserver.io to see how to get support.

Edited by linuxserver.io
Link to comment

Something is not right. I downloaded the docker and although nginx is advertised apache2 was deployed... LOL

 

The nginx.xml files looks like this:

 

<?xml version="1.0" encoding="utf-8"?>
<Container>
<Beta>False</Beta>
<Category>Network:Web Network:Proxy</Category>
<Date>2015-12-05</Date>
  <Name>Nginx</Name>
  <Support>http://lime-technology.com/forum/index.php?topic=44481.0</Support>
  <Overview>is a web server with a strong focus on high concurrency, performance and low memory usage. It can also act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache.</Overview>
  <Changes>
[center][img width='300px' src='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_small.png'][/center]



[center][font size=4]Nginx Change Log[/font][/center]

[b]06.12.2015:[/b] Initial Release</Changes>
  <Description>is a web server with a strong focus on high concurrency, performance and low memory usage. It can also act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache..[br]
  [b][u][span style='color: #E80000;']Configuration[/span][/u][/b][br]
  [b]80[/b] Standard HTTP Port [br]
  [b]443[/b] Standard HTTPS Port [br]
  [b]/config[/b]Storing Configuration and the www folder[br]
  </Description>
  <Project>https://www.nginx.com/</Project>
  <Registry>https://registry.hub.docker.com/u/linuxserver/nginx/</Registry>
  <Repository>linuxserver/apache</Repository>
  <BindTime>true</BindTime>
  <Privileged>false</Privileged>
  <Environment>
    <Variable>
      <Name>PUID</Name>
      <Value>99</Value>
    </Variable>
    <Variable>
      <Name>PGID</Name>
      <Value>100</Value>
    </Variable>
  </Environment>
  <Networking>
    <Mode>bridge</Mode>
    <Publish>
      <Port>
        <HostPort>80</HostPort>
        <ContainerPort>80</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
      <Port>
        <HostPort>443</HostPort>
        <ContainerPort>443</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
    </Publish>
  </Networking>
  <Data>
    <Volume>
      <HostDir>/mnt/user/appdata/nginx</HostDir>
      <ContainerDir>/config</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
  </Data>
  <Version></Version>
  <WebUI>http://[iP]:[PORT:80]/</WebUI>
  <Banner>https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-banner.png</Banner>
  <Icon>https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-icon.png</Icon>
  <ExtraParams></ExtraParams>
</Container>

 

I think the wrong repository is listed

Link to comment

Something is not right. I downloaded the docker and although nginx is advertised apache2 was deployed... LOL

 

The nginx.xml files looks like this:

 

<?xml version="1.0" encoding="utf-8"?>
<Container>
<Beta>False</Beta>
<Category>Network:Web Network:Proxy</Category>
<Date>2015-12-05</Date>
  <Name>Nginx</Name>
  <Support>http://lime-technology.com/forum/index.php?topic=44481.0</Support>
  <Overview>is a web server with a strong focus on high concurrency, performance and low memory usage. It can also act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache.</Overview>
  <Changes>
[center][img width='300px' src='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_small.png'][/center]



[center][font size=4]Nginx Change Log[/font][/center]

[b]06.12.2015:[/b] Initial Release</Changes>
  <Description>is a web server with a strong focus on high concurrency, performance and low memory usage. It can also act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache..[br]
  [b][u][span style='color: #E80000;']Configuration[/span][/u][/b][br]
  [b]80[/b] Standard HTTP Port [br]
  [b]443[/b] Standard HTTPS Port [br]
  [b]/config[/b]Storing Configuration and the www folder[br]
  </Description>
  <Project>https://www.nginx.com/</Project>
  <Registry>https://registry.hub.docker.com/u/linuxserver/nginx/</Registry>
  <Repository>linuxserver/apache</Repository>
  <BindTime>true</BindTime>
  <Privileged>false</Privileged>
  <Environment>
    <Variable>
      <Name>PUID</Name>
      <Value>99</Value>
    </Variable>
    <Variable>
      <Name>PGID</Name>
      <Value>100</Value>
    </Variable>
  </Environment>
  <Networking>
    <Mode>bridge</Mode>
    <Publish>
      <Port>
        <HostPort>80</HostPort>
        <ContainerPort>80</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
      <Port>
        <HostPort>443</HostPort>
        <ContainerPort>443</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
    </Publish>
  </Networking>
  <Data>
    <Volume>
      <HostDir>/mnt/user/appdata/nginx</HostDir>
      <ContainerDir>/config</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
  </Data>
  <Version></Version>
  <WebUI>http://[iP]:[PORT:80]/</WebUI>
  <Banner>https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-banner.png</Banner>
  <Icon>https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-icon.png</Icon>
  <ExtraParams></ExtraParams>
</Container>

 

I think the wrong repository is listed

 

 

fixt, thanks for letting us know.

Link to comment

Something is not right. I downloaded the docker and although nginx is advertised apache2 was deployed... LOL

 

The nginx.xml files looks like this:

 

<?xml version="1.0" encoding="utf-8"?>
<Container>
<Beta>False</Beta>
<Category>Network:Web Network:Proxy</Category>
<Date>2015-12-05</Date>
  <Name>Nginx</Name>
  <Support>http://lime-technology.com/forum/index.php?topic=44481.0</Support>
  <Overview>is a web server with a strong focus on high concurrency, performance and low memory usage. It can also act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache.</Overview>
  <Changes>
[center][img width='300px' src='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_small.png'][/center]



[center][font size=4]Nginx Change Log[/font][/center]

[b]06.12.2015:[/b] Initial Release</Changes>
  <Description>is a web server with a strong focus on high concurrency, performance and low memory usage. It can also act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache..[br]
  [b][u][span style='color: #E80000;']Configuration[/span][/u][/b][br]
  [b]80[/b] Standard HTTP Port [br]
  [b]443[/b] Standard HTTPS Port [br]
  [b]/config[/b]Storing Configuration and the www folder[br]
  </Description>
  <Project>https://www.nginx.com/</Project>
  <Registry>https://registry.hub.docker.com/u/linuxserver/nginx/</Registry>
  <Repository>linuxserver/apache</Repository>
  <BindTime>true</BindTime>
  <Privileged>false</Privileged>
  <Environment>
    <Variable>
      <Name>PUID</Name>
      <Value>99</Value>
    </Variable>
    <Variable>
      <Name>PGID</Name>
      <Value>100</Value>
    </Variable>
  </Environment>
  <Networking>
    <Mode>bridge</Mode>
    <Publish>
      <Port>
        <HostPort>80</HostPort>
        <ContainerPort>80</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
      <Port>
        <HostPort>443</HostPort>
        <ContainerPort>443</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
    </Publish>
  </Networking>
  <Data>
    <Volume>
      <HostDir>/mnt/user/appdata/nginx</HostDir>
      <ContainerDir>/config</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
  </Data>
  <Version></Version>
  <WebUI>http://[iP]:[PORT:80]/</WebUI>
  <Banner>https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-banner.png</Banner>
  <Icon>https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-icon.png</Icon>
  <ExtraParams></ExtraParams>
</Container>

 

I think the wrong repository is listed

 

I'd like to add that we will humiliate the member responsibly on your behalf...  ;D

Link to comment

Not sure if proper place to post but as a home user what benefit will I receive from using this? Will it "cache" information to pages/frequent downloads faster?

 

Thought I had read about people using nginx to cache steam / windows update etc not sure if I am mixing it up with something else tho... Thanks and sorry if in wrong location.

Link to comment

Is there a guide somewhere on how to get the reverse proxy working? I've always wanted to do this to make all the different services such as Sabnzbd and Sickrage easier to access. I've been messing with it for about 2 hours now and I'm completely lost...

 

Hey bb12489,

 

I wrote a guide a while back for Apache (https://www.linuxserver.io/index.php/overview-reverse-proxy-with-docker/). I just converted over to nginx and do not have a write up yet (i plan too, just been busy)

 

Here is my old apache config - https://www.seandion.com/owncloud/index.php/s/R4tJqfqb4opuOsp

Here is my new nginx config - https://www.seandion.com/owncloud/index.php/s/XpFigScMblZO2dJ

 

Those should help a bit more and I will be doing an nginx addition to that guide.

Link to comment

Is there a guide somewhere on how to get the reverse proxy working? I've always wanted to do this to make all the different services such as Sabnzbd and Sickrage easier to access. I've been messing with it for about 2 hours now and I'm completely lost...

 

Hey bb12489,

 

I wrote a guide a while back for Apache (https://www.linuxserver.io/index.php/overview-reverse-proxy-with-docker/). I just converted over to nginx and do not have a write up yet (i plan too, just been busy)

 

Here is my old apache config - https://www.seandion.com/owncloud/index.php/s/R4tJqfqb4opuOsp

Here is my new nginx config - https://www.seandion.com/owncloud/index.php/s/XpFigScMblZO2dJ

 

Those should help a bit more and I will be doing an nginx addition to that guide.

 

Thank you! This will be a weekend project for sure.

Link to comment
  • 3 weeks later...

So I have been having a play with this docker for a websites I host and it is working amazing pairs with your mysql docker.

 

One question I have is; is there a way to upgrade the php version if needed? It is currently running a version that is around a year old now.

 

I'm aware it is most likely something that would need to be changed in the docker itself but it's worth an ask :)

 

Regards,

Jamie

Link to comment
  • 3 weeks later...

Hi can I just check is there any reason why my nginx server has issues with serving up css files? I am trying to serve static sites generated by Hugo. I have an apache server that is behind nginx, and nginx is used as a reverse proxy.

 

When I visit apache directly, the site displays correctly. But when I attempt to access it through nginx however, the site comes out completely unstyled. I tested the .css links inside the page's source and there are no issues, as in I am able to see the css directly. Its just for some reason the css does not render out.

 

For the avoidance of doubt, I mainly use this nginx server just as a reverse proxy and for ssl encryption.

 

This is the config i have for nginx:

server {
server_name xxx.me www.xxx.me;
listen 443 ssl;
root /config/www;
index index.html index.htm index.php;

### Set Certificates ###
ssl_certificate /certs/live/junxuan.me/fullchain.pem;
   	ssl_certificate_key /certs/live/junxuan.me/privkey.pem;

### Add Diffie–Hellman key exchange ###
ssl_dhparam /etc/ssl/certs/dhparam.pem;

### Disable SSL by enforcing TLS ###
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

### Add some ciphers and reject weaker ones ###
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;

### Add HTTP Strict Transport Security ###
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Front-End-Https on;

###Other Settings ###
client_max_body_size 0m;

location / {
	### Proxy Pass Info ###
	proxy_pass http://192.168.0.101:8082/; <-- this is my apache server
}
}

server {
listen 80;
server_name www.xxx.me;
return 301 https://$server_name$request_uri;
}

Link to comment

I am having the same issue as Keepitshut. Nginx is working, but css files are not.

 

hey man, i figured out the problem for mine. Mine was because my assets were being loaded over normal http and thus was being blocked by the browser. Not sure if it is the same for you, but should be worth checking out.

Link to comment
  • 2 weeks later...

Nope, I would like it accessible from multiple hosts.  I'm actually already running nginx on another VM, but would like to eliminate it if possible. So the question is, is it possible to change the port that the UNRAID webGUI is running on? I could easily reverse proxy it after the fact.

 

It is possible to change the default port for Unraid.  However, the other way of doing it is what I do, I run my webserver on port 81 and forward port 80 on my router to port 81 on Unraid.  So any requests to my domain name still work and I get to leave Unraid where it is...

 

To change the Unraid port though, look here.

Link to comment

How can I update the version of nginx to one which supports HTTP2?

 

The version in the docker is 1.4.6. HTTP2 has been supported since 1.9.5. I see that the docker automatically updates when starting, but from ubuntu trusty repos which have an old version of nginx.

 

A newer version is available in:

 

deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx

Link to comment

That may not survive a reboot or container restart.

It survives rebooting, doesn't survive editing the container or updating the container.

 

Any chance of getting the container to include repositories with a more recent version of nginx by default? The current version (1.4+backported security fixes) is nearly two years old.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.