Coder Social home page Coder Social logo

Comments (9)

xplicit avatar xplicit commented on May 24, 2024

Could you share a sample project, which demonstates an issue?

from hyperfastcgi.

xplicit avatar xplicit commented on May 24, 2024

Without sample project and nginx configuration it's difficult to say what caused the issue, I just can guess that this could be due to path passing from nginx to web server. You can try to use these nginx params to split the URL (change the first regex to regex which matche your web services path.

fastcgi_split_path_info ^((?U).+\.as.x)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

from hyperfastcgi.

WilliamCVan avatar WilliamCVan commented on May 24, 2024

Hello, sorry for the delay, but I've uploaded my sample project here:
https://onedrive.live.com/?cid=9cd23b281473873d&id=9CD23B281473873D!209

I tried the nginx regex you posted and am getting 403 errors when i try to access the webpage.

from hyperfastcgi.

xplicit avatar xplicit commented on May 24, 2024

I tried your application. You need to add fastcgi params to split url to your web service into two. These params work well for your app.

fastcgi_split_path_info ^(.+\.as.x)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

from hyperfastcgi.

WilliamCVan avatar WilliamCVan commented on May 24, 2024

Can you post your nginx config file? Mine keeps throwing these 2 errors:

My location{} in nginx.conf:

location / {
fastcgi_index Default.aspx;
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.as.x)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

First Page Visit:

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.
Exception stack trace:
  at System.Web.Util.UrlUtils.Canonic (System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRequest.get_FilePath () [0x00000] in <filename unknown>:0 
  at System.Web.HttpRequest.get_BaseVirtualDir () [0x00000] in <filename unknown>:0 
  at System.Web.HttpRequest.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Hosting.HostingEnvironment.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Hosting.DefaultVirtualPathProvider.DirectoryExists (System.String virtualDir) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.FindWebConfig (System.String path, System.Boolean& inAnotherApp) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration (System.String path, System.String site, System.String locationSubPath, System.String server, System.String userName, System.String password, Boolean fweb) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetReferencedAssemblies () [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.CallPreStartMethods () [0x00000] in <filename unknown>:0 

Second Page Refresh:

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.
Exception stack trace:
  at System.Web.Util.UrlUtils.Canonic (System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRequest.get_FilePath () [0x00000] in <filename unknown>:0 
  at System.Web.HttpRequest.get_BaseVirtualDir () [0x00000] in <filename unknown>:0 
  at System.Web.HttpRequest.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Hosting.HostingEnvironment.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Hosting.DefaultVirtualPathProvider.DirectoryExists (System.String virtualDir) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.FindWebConfig (System.String path, System.Boolean& inAnotherApp) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration (System.String path, System.String site, System.String locationSubPath, System.String server, System.String userName, System.String password, Boolean fweb) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.AppCodeCompiler.Compile () [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00000] in <filename unknown>:0

from hyperfastcgi.

xplicit avatar xplicit commented on May 24, 2024

nginx config

 upstream fastcgi_backend {
    server 127.0.0.1:9000;
    keepalive 32;
 }


  location / {
             root /var/www/nginx-mono/;
             index index.html index.htm default.aspx Default.aspx;
             fastcgi_index Default.aspx;
             fastcgi_keep_conn on;
             fastcgi_pass fastcgi_backend;
             fastcgi_split_path_info ^(.+\.as.x)(/?.+)$;
             include /etc/nginx/fastcgi_params;
  }

Check myweb888.webapp file, that path is pointed to the directory where your web application is located.

from hyperfastcgi.

WilliamCVan avatar WilliamCVan commented on May 24, 2024

I start the HyperFastCGI process with:

hyperfastcgi4 /applications=/:/opt/nginx/html/myweb888Com/ /config=/opt/nginx/conf/HFC2.conf /logfile=/opt/nginx/logs/HFast.log

My full config for nginx:

upstream fastcgi_backend {
    server 127.0.0.1:9000;
    keepalive 32;
 }

server {
server_name www.domain.com;

access_log /opt/nginx/logs/access.log;
error_log /opt/nginx/logs/error.log;

listen 80;

location / {
     root /opt/nginx/html/myweb888Com/;
         index index.html index.htm default.aspx Default.aspx;
         fastcgi_index Default.aspx;
         fastcgi_keep_conn on;
         fastcgi_pass fastcgi_backend;
         fastcgi_split_path_info ^(.+\.as.x)(/?.+)$;
         include /opt/nginx/conf/fastcgi_params;
}
}

I now get the following error when I click the [Call WebMethod] button. Website loads fine, ajax request bombs still with:

System.ArgumentOutOfRangeException
Argument is out of range. Parameter name: startIndex

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): mscorlib.
Exception stack trace:
at System.String.Substring (Int32 startIndex) [0x00000] in <filename unknown>:0 
at System.Web.Script.Services.RestHandler..ctor (System.Web.HttpContext context, System.Type type, System.String filePath) [0x00000] in <filename unknown>:0 
at System.Web.Script.Services.RestHandler.GetHandler (System.Web.HttpContext context, System.Type type, System.String filePath) [0x00000] in <filename unknown>:0 
at System.Web.Handlers.ScriptModule.PostAcquireRequestState (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication+<RunHooks>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0 
at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0 

My HFast.log output:
capture

from hyperfastcgi.

xplicit avatar xplicit commented on May 24, 2024

Do you have these definitions in /opt/nginx/conf/fastcgi_params?

fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

from hyperfastcgi.

WilliamCVan avatar WilliamCVan commented on May 24, 2024

The above fix you provided fixed my last exception. Thanks for being patient and helping me solve my issue. Amazing piece of software you've written, can't thank you enough Sergey. Issue closed.

from hyperfastcgi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.