OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of sharif779 »
  • Show Posts »
  • Topics
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

  • Messages
  • Topics
  • Attachments

Topics - sharif779

Pages: [1]
1
19.7 Legacy Series / Convert lighttpd to nginx in Opnsense
« on: June 11, 2019, 12:50:52 pm »
I want to change lighttpd to nginx as default web server. I have already installed and changed configuration in nginx server like lighttpd but api and ui routing is not working.
Here is my changed code for nginx configuration
Code: [Select]
server {
listen 80;

server_name _;

root /usr/local/www;
index index.php index.html;
        location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
       
        location /ui/{
    alias /usr/local/opnsense/www/;
    try_files $uri $uri/ /ui//ui/index.php?_url=$uri&$args;
    location ~ /ui/.+\.php$ {
                include fastcgi_params;
                fastcgi_buffers 256 4k;
                fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            }
        }

location /api/{
    alias /usr/local/opnsense/www/;
    try_files $uri $uri/ /api//api/api.php?_url=$uri&$args;
    location ~ /api/.+\.php$ {
                include fastcgi_params;
                fastcgi_buffers 256 4k;
                fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            }
        }

        location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
    }
}
   
After changing config api response is
Code: [Select]
{
    "message": "controller OPNsense\\Core\\Api\\IndexController not found",
    "status": 400
}
I have added IndexController though this controller was not in opnsense but it is not working at all.
Can you please help.It is needed to change web server .

2
19.7 Legacy Series / Opnsense for debian
« on: February 27, 2019, 12:51:42 pm »
Is it possible to run opnsense in Debian environment though it is FreeBSD based.

3
General Discussion / How can I use function of inc file in my api inside Phalcon mvc framework
« on: January 30, 2019, 10:48:22 am »
Dear all,
When I used
Code: [Select]
get_interfaces_info() this function from interfaces.inc in my api controller then following error occurred
Code: [Select]
{"errorMessage":"[color=red]Error at /usr/local/etc/inc/interfaces.inc:4827 - Undefined index: status (errno=8)"}[/color] . But when I used same function on my static php page inside
Code: [Select]
/usr/local/www/   there is no error occurred.

Is it possible that function inside api controller.If possible then how can I use it?
I am using 17.7 .

Pages: [1]
OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2