pfSense Gold Subscription

Author Topic: custom page : nginx error  (Read 86 times)

0 Members and 1 Guest are viewing this topic.

Offline ghislain

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
custom page : nginx error
« on: April 20, 2017, 08:09:18 am »
Hello i import my captive portal custom page from pf 2.1 to my new 2.3 and i have this error when i press view (current Portal page)

nginx: 2017/04/20 11:36:53 [error] 43923#100286: *422 open() "/usr/local/www/captiveportal-inputImgIdentifiant.png" failed (2: No such file or directory), client: 172.17.0.67, server: , request: "GET /captiveportal-inputImgIdentifiant.png HTTP/1.1", host: "172.17.2.251:4433", referrer: "https://172.17.2.251:4433/services_captiveportal.php?zone=wifi_public&act=viewhtml"


of course it do not find my png : file manager do not put in in this directory.

can some one help me ?

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +133/-5
    • View Profile
Re: custom page : nginx error
« Reply #1 on: April 20, 2017, 08:20:48 am »
Hello i import my captive portal custom page from pf 2.1 to my new 2.3 and i have this error when i press view (current Portal page)
Did you adapt it ? (you mentioned an ancient version, and somewhere in the past a new field appeared)


nginx: 2017/04/20 11:36:53 [error] 43923#100286: *422 open() "/usr/local/www/captiveportal-inputImgIdentifiant.png" failed (2: No such file or directory), client: 172.17.0.67, server: , request: "GET /captiveportal-inputImgIdentifiant.png HTTP/1.1", host: "172.17.2.251:4433", referrer: "https://172.17.2.251:4433/services_captiveportal.php?zone=wifi_public&act=viewhtml"
Did you upload the file "inputImgIdentifiant.png" that you have on your PC to pfSense ? (this file will be available in your scripts as "captiveportal-inputImgIdentifiant.png".

of course it do not find my png : file manager do not put in in this directory.
YOU have to put it there using the filemanager.

Offline ghislain

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: custom page : nginx error
« Reply #2 on: April 20, 2017, 09:27:03 am »
I do not use backup/restore module

I use filemanager to upload my png and css.

and push my html index.

it work for the html index page but not find css, png background: file manager do not put it on /usr/local/www/ but in /var/db/cpelements

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 1666
  • Karma: +133/-5
    • View Profile
Re: custom page : nginx error
« Reply #3 on: April 20, 2017, 05:14:15 pm »
it work for the html index page but not find css, png background: file manager do not put it on /usr/local/www/ but in /var/db/cpelements
Why are you looking in /var/local/www/ ? That this the home dir for the GUI.
The one for the captive portal is here : /usr/local/captiveportal (you should know that nginx is running with one instance for the GUI, and another for the Captive portal and yet another one if you have the https version of the Captive portal - check out config files for nginx here : /var/etc - check files that start with nginx- )
.... and the surprise is :
In that directory you will find your "index.php" and soft links to the files you upload with the file manager.
Like (my setup) :
Code: [Select]
[2.3.3-RELEASE][admin@pfsense.brit-hotel-fumel.net]/usr/local/captiveportal: ls -al
total 40
drwxr-xr-x   2 root  wheel    512 Mar 14 09:45 .
drwxr-xr-x  16 root  wheel    512 Apr 13 22:00 ..
lrwxr-xr-x   1 root  wheel     39 Oct 16  2015 captiveportal-bg.jpg -> /var/db/cpelements/captiveportal-bg.jpg
lrwxr-xr-x   1 root  wheel     59 Jan 29  2015 captiveportal-logo_brit_hotel_relief.jpg -> /var/db/cpelements/captiveportal-logo_brit_hotel_relief.jpg
lrwxr-xr-x   1 root  wheel     42 Jan 29  2015 captiveportal-style.css -> /var/db/cpelements/captiveportal-style.css
-rw-r--r--   1 root  wheel  11603 Feb 11 14:50 index.php
-rw-r--r--   1 root  wheel  10434 Feb 11 14:50 radius_accounting.inc
-rw-r--r--   1 root  wheel   6862 Feb 11 14:50 radius_authentication.inc

So, the files used by my index.php -  captiveportal-bg.jpg - captiveportal-logo_brit_hotel_relief.jpg - captiveportal-style.css are perfectly well readable.

This is how it works for years now - still don't know why it doesn't for you.