Comments (9)
Could you share a sample project, which demonstates an issue?
from hyperfastcgi.
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.
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.
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.
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.
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.
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
from hyperfastcgi.
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.
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)
- Seeing requests with about 46k of request body data fail with 502 under mono-server-hyperfastcgi4 HOT 3
- Will HyperFastCgi support .NET Core (ASP .NET 5)? HOT 1
- hyperfastcgi stop working but not crash HOT 11
- Trying to test NativeTransport and getting DllNotFoundException HOT 12
- compile agains mono 4.8.0 fail HOT 4
- 502 with Nginx HOT 5
- segfault after interrupting hung process with /stoppable=true HOT 2
- Weird Exception while initOnce HOT 1
- Similar issue with #67, 502 after 50k requests HOT 4
- Hyperfastcgi crashing HOT 4
- HyperFastCgi crashes if there is nothing in the webapp folder HOT 1
- configfile difficult to use HOT 1
- fcgi-transport.c:444: parse_params(): Can't find app! HOST='my.host' port=443 path='/index.aspx' HOT 4
- How can I set the umask for the process?
- No package 'mono-2' found, хотя mono установлен HOT 1
- Configuration location for ApplicationPoolRecycling HOT 2
- Error calling 'bufferevent_free' twice in NativeTransport on request end
- Probably race condition? HOT 1
- hyperfastcgi in nginx default server
- Managed Listener leaks sockets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperfastcgi.